AP Invoice Group Load

I’m creating a screen customization that uploads a CSV file to automate a fairly straightforward process. The user creates a new AP invoice group and then selects the file to load. I parse the records in the file and then load the AP invoices and receipts in the background using APInvoiceSvc. The records are being generated properly but I cannot figure out how to show the records I’ve added to the group into the screen that is currently open. I’ve tried oTrans.NotifyAll(true), oTrans.Refesh(), oTrans.Update(), but the only thing that really seems to work is manually clearing the form and then retrieving the group that was previously loaded. Does anyone have any suggestions on how to handle this?

Try → oTrans.Update(true);

Use the group adapter and do a GetByID.

I’ve tried both suggestions but the screen still does not show the loaded records. Here’s what I’ve added after the records are loaded into the background:

            var myadapt = ((Erp.Adapters.APInvGrpAdapter)csm.TransAdaptersHT["oTrans_groupAdapter"]);
            myadapt.GetByID(myGroupID);
            oTrans.Update(true);
            oTrans.NotifyAll(true);

Any other ideas / suggestions? I’m considering setting the value on the control but not sure how to code leaving the control after setting the value

oTrans.ClearDataSets();
var mybox = (EpiTextBox)csm.GetNativeControlReference("39f79241-22c5-4851-a3c7-f2290dc372df");
mybox.Value = myGroupID;
//somehow move focus or tab on the control?
1 Like

Try oTrans.Refresh();

Thanks for the suggestion! Unfortunately that didn’t work. It seems like after setting the value, I need to press tab on the control manually for some reason

I have code like this:

oTrans.Update();
oTrans.NotifyAll();
oTrans.Refresh();

for refresh the screen

Thanks again. Unfortunately that did not work on this screen either. Anyway I ended up finding the correct combination so am posting this in case anyone ever needs it in the future:

oTrans.ClearDataSets();
var mybox = (EpiTextBox)csm.GetNativeControlReference("39f79241-22c5-4851-a3c7-f2290dc372df");
mybox.Value = myGroupID;
oTrans.ValidateKeyField(mybox);
1 Like