Dear Epicor community,
I would like to update theShipViaCode on the Miscellaneous Shipment entry menu when order # is changed but not saved (so Data directive is out of question). There is a field that is called MscShpHd.OrderNum and a button that runs the BO object Erp.BO.MiscShipDataSet
Just to provide more context, the value of the ShipViaCode will change and the dropdown will get updated only after saving if Data Directive is used, but I need to update this field when a new order number is loaded (not just typed, either selection through button or type and then tab button on keyboard). And also my purpose is solely updating the representation of the form and not affecting the database at all (we would like to show the Order#'s ShipVia code and just show it at this step without changing anything in the database since it is on a tt dataset).
If by any chance my explanation is not clear please let me know.
Here is the CustomCode on Data Directives that I currently use:
int ordernum = 0;
string shipviacode = "";
string company = "";
if(ttMscShpHd.Any())
{
foreach(var mscshphdrow in ttMscShpHd)
{
company = mscshphdrow.Company;
ordernum = mscshphdrow.OrderNum;
}
foreach (var OrderHedRow in (from OrderHed_Row in Db.OrderHed
where OrderHed_Row.Company == company && OrderHed_Row.OrderNum == ordernum
select OrderHed_Row))
{
shipviacode = OrderHedRow.ShipViaCode;
}
foreach(var mscshphdrow in ttMscShpHd)
{
mscshphdrow.ShipViaCode = shipviacode;
foreach(var mscshphdrow2 in ttMscShpHd)
{
mscshphdrow2.ShipViaCode =shipviacode;
}
}
}
I tried looking among Method Directives and could not find anything relevant except MiscShip
Right now I have achieved this through DataDirective when save is pressed but I am hopiong to find a solution that the tt table gets updated without impacting the database.
Many thanks in advance for your help.
Kind Regards,
Shizar