/*
In many Epicor10 foms,there are controls that cannot be accessd directly because they are not stanard control types.
For example, on the IssueReturn form, the From Warehouse dropdown is a control of type Erp.Adapters.Controls.IRWarehouseCombo. But I am unable to use this control type in the script section in the standard fashion:
IRWarehouseCombo cbo = (IRWarehouseCombo)csm.GetNativeControlReference("GUID");
This makes it difficult to change the value of this field. However, you can do so by
1. Changing the value of the underlying form data
2. Creating a generic reference to the IRWarehouseCombo element
3. Updating the generic reference
In the following snippet, I am setting the FromWarehouse and the FromBin to the location identified in earlier code, identified as MyWarehouseCode, MyWarehouseCodeDescription, and MyBinNumber.
*/
EpiDataView dvIM = (EpiDataView)oTrans.EpiDataViews["IM"]; // Gets the underlying IssueMaterial data for the form.
Erp.BO.IssueReturnDataSet.IssueReturnRow irr = (Erp.BO.IssueReturnDataSet.IssueReturnRow)dvIM.CurrentDataRow; // Gets the row data and casts it as an IssueRetunRow
irr.FromWarehouseCode = MyWarehouseCode;
irr.FromWarehouseCodeDescription = MyWarehouseCodeDescription; // Needed so the dropdown box shows the correct text for the warehouse
irr.FromBinNum = MyBinNumber;
var cmbWhse = csm.GetNativeControlReference("d8cbd6bd-beed-4ca7-803c-f5a1023e4bbd"); // Gets the IRWarehouseCombo control as a generic Control
cmbWhse.Update(); // Update Warehouse Display
Bin.Update(); // Update Bin Disply