BAQCombo on Form Customization and setting default value

I am using a BAQCombo on a Form Customization. I am trying to set the default value upon Form_Load using the following code:

var altbuyer = (BAQCombo)csm.GetNativeControlReference(“a667f302-c9f2-443a-ab3c-ee91666dbdde”);
altbuyer.SelectedText = “”;

var altship = (BAQCombo)csm.GetNativeControlReference(“3579d761-9b3f-4501-9596-1be6236f43ae”);
altship.SelectedText = “”;

The first one works fine, but it will not set the second one. Any thoughts?

Just want to clarify the code a little bit better:

private void ReqEntryForm_Load(object sender, EventArgs args)
	{
		// Add Event Handler Code
		var altbuyer = (BAQCombo)csm.GetNativeControlReference("a667f302-c9f2-443a-ab3c-ee91666dbdde");
		altbuyer.SelectedText = "<Default>";
		
		var altship = (BAQCombo)csm.GetNativeControlReference("3579d761-9b3f-4501-9596-1be6236f43ae");
		altship.SelectedText = "<Default>";
	}

If this is tied to a data field, you should work with the dataview instead.
If the field is not bound, then you wont need the csm.GetNativeControlRefrence. You can use the name of the control directly.
Lastly, if you are editing the control’s value, you would use altship.Value instead.

Jason,
Thanks for the input. I think I want to clarify one thing that I am not sure will work with that option. I could be wrong though. But yes it is tied to a ReqHead_UD field.

Anyway, we want the value to be initially in the ComboBox so that the user will not need to choose unless necessary. This is to notify us if they choose to go with the default or override the default.

So, it is not necessary for them to even touch the dropdown. So, I want the default to be noted from the beginning.

I just do not understand how the Buyer code works fine but the ShipVia Code does not work. Both of these are on the Load portion to just display the Default.

There are a few things here:

  1. For EpiCombo to use the ReqHead_UD values, change the “ListDataSet” to “RowsDataSet”. This calls GetRows (which includes the UD fields, but takes more memory) instead of GetList (which is only a subset of data).
  2. Defaulting values are best done in a BPM. For instance, on Post-processing in GetNewXYZ.