Enter Value in BAQCombo from Customization

Good morning,
I have a form where users enter temporary inventory quantities for jobs until the jobs get closed. One part of the form is a BAQCombo listing all the warehouses. They can pick a warehouse to add the inventory to.

At the bottom of the dashboard, I list all of the inventory values stored in my temporary UD09 table. This is so users can see what has already been entered. Sometimes they want to combine records, but there is no easy way to do that yet. They have to delete the record, remember the quantity and reenter the record with the new total qty.

I’d like to avoid this by letting the user click an existing record from the table, and have the record load into the text fields and combo boxes to be edited. Using the code below I can sense when the user clicks a row in my grid, and then I can set the values of all the controls except for my BAQCombo:

	private void V_UD_OpenJobInventory_1View_AfterRowChange(EpiRowChangedArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.LastRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
		MyPartNum.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Key1"].ToString();
		epiRevs.Value=args.CurrentView.dataView[args.CurrentRow]["UD09_Key2"].ToString();
		MyQuantity.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Number01"].ToString();
		epiStatus.Value=args.CurrentView.dataView[args.CurrentRow]["UD09_Key3"].ToString();
		baqComboC1.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Key5"].ToString();		
		epiUltraComboC1.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_ShortChar01"].ToString();
		epiJobs.Value=args.CurrentView.dataView[args.CurrentRow]["UD09_Key4"].ToString();
		MyNotes.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Character01"].ToString();
		MyDate.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Date01"].ToString();

	}

I have tried accessing the .Text, and .Value. As well as assigning the BAQcombo to its own variable like:

public BAQCombo cmbWhse;
cmbWhse = (Ice.Lib.Framework.BAQCombo)csm.GetNativeControlReference("ab3e6a13-bcc2-45bb-8f27-e93f11951026");

And I tried using the cmbWhse.Text and .Value.

None of these resulted in a change to the BAQCombo box. All the other controls get filled in correctly, but the warehouse combo stays blank.

The whouse combo is fed by a static BAQ that just lists the warehouses that I care about. I tried removing the BAQ link and display/value members from the combo box before setting the value. But that didn’t work either.

What am I missing here?
Thanks!
Nate

I think you’ll have to mess with the .DataSource property, can’t remember off the top of my head.

I was thinking that too! Setting baqComboC1.DataSource=“”; did not help.

No I mean you’ll have to make one, not set it to “”;

What would I change it to? Since the whouse list is pretty much static, I should just use the original warehouse BAQ. Right? That’s what I have now. I don’t get why it won’t set the value of the combo. For example Key5 = FG, I should see FG get populated in the whouse combo, but it just stays blank.

try setting the value, then clear the datasource, then set it back to original, then force refresh the baq
combo.

or something like that, might have my order wrong.

I have tried a few variations of this:

	
		baqComboC1.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Key5"].ToString();	
		DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
		dqa.BOConnect();		
		QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("Warehouses");
		qeds.ExecutionParameter.Clear();
		dqa.ExecuteByID("Warehouses", qeds);

 	   cmbWhse = (Ice.Lib.Framework.BAQCombo)csm.GetNativeControlReference("99828d84-511f-4c92-9f4e-94c24f4cd166");
		cmbWhse.DataSource = "Warehouses";
		cmbWhse.DisplayMember = "Warehse_WarehouseCode";
		cmbWhse.ValueMember = "Warehse_WarehouseCode";
		oTrans.NotifyAll();	
		baqComboC1.ForceRefreshList();
		baqComboC1.Text=args.CurrentView.dataView[args.CurrentRow]["UD09_Key5"].ToString();

But I am not getting anywhere. I can return the value of UD09Key5 to a messagebox, so I know the value is there. I just can’t get it to stick in the combo box. So strange!

I’ve done it a million times. My brain just isn’t working.

If I remember, I’ll pop back in.

Try simply this:

cmbWhse.Value = "your value"; //must be exact
cmbWhse.ForceRefreshList();
1 Like

This worked!

 	   cmbWhse = (Ice.Lib.Framework.BAQCombo)csm.GetNativeControlReference("99828d84-511f-4c92-9f4e-94c24f4cd166");
		cmbWhse.Value = args.CurrentView.dataView[args.CurrentRow]["UD09_Key5"].ToString();
		cmbWhse.ForceRefreshList();

Thank you for your help!

1 Like

Since it was bound to a dataview, you could probably set the current row there too.
Might still have to force refresh.