I am trying to customize the A/P Invoice entry screen to select a default Payment Method when a new invoice is created, but I’m running into issues getting the combobox to update with the value, whether I try to set it with a BPM or a customization. Looking online, this seems to be a real problem but none of the solutions presented are working. I must be missing something fundamental. How can I set a default value for a combobox?
Here is the code I’m trying to use for a customization (since the usual “Set Field” BPM didn’t work):
private void edvAPInvHed_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.AddRow))
{
if ((args.Row > -1))
{
view.dataView[args.Row]["PMUID"] = 1;
Erp.UI.Controls.Combos.PayMethodCombo cmbPayMethod = (Erp.UI.Controls.Combos.PayMethodCombo)csm.GetNativeControlReference("21090ca0-7f09-4161-8b90-e13277437d25");
cmbPayMethod.Retrieve();
oTrans.NotifyAll();
}
}
}
The code compiles, but doesn’t set the default payment method as expected.
Thanks.