Hello,
Let me begin by mentioning the potential bug in the current D365 version. When we navigate:
Released Products / Manage Inventory - Transactions / Purchase Order Link (See the screenshots below)
For our immediate need to resolve this, I have started extending this form by utilizing JumpRef and other form methods. But quite not getting what we expect.
So far, we have
1. JumpRef method Post Event Handler on InventTrans form's field method
[FormControlEventHandler(formControlStr(InventTrans, InventTransOrigin_ReferenceId), FormControlEventType::JumpRef)]
public static void InventTransOrigin_ReferenceId_OnJumpRef(FormControl sender, FormControlEventArgs e)
{
// Send Args with PO# (PurchTable Record)
PurchId purchid = sender.valueStr();
MenuFunction menuFunction;
Args args;
PurchTable purchTable = PurchTable::find(purchid);
FormRun formRun;
info(strFmt("Your PO Number is %1",purchTable.PurchId));
if(purchTable.RecId != 0)
{
args = new Args();
args.record(purchTable);
args.caller(sender);
args.name(formStr(PurchTable));
formRun = classFactory.formRunClass(args);
FormDataSource ds = formRun.dataSource(formDataSourceStr(PurchTable,purchTable)) as FormDataSource;
formRun.init();
formRun.run();
formRun.wait();
}
2. Init method on PurchTable - Pre-Event Handler
[PreHandlerFor(formStr(PurchTable), formMethodStr(PurchTable, init))]
public static void PurchTable_Pre_init(XppPrePostArgs args)
{
FormRun fr = args.getThis();
Common common = fr.args().record();
PurchTable purchTable;
if (common is PurchTable)
{
purchTable = common;
fr.args().lookupRecord();
}
}
We are able to pass PurchId when we click on from originating form to PurchTable form but it still opens a blank PO# form.
Any thoughts or suggestions? Thank you in advance.
Screenshots for reference:
Yes I navigate to the above form and able to navigate to the Purch table form with the selected record.
I think there is some customization which is causing the issue.
Please debug the code and find out the issue.
Thanks,
Girish S.
Hi Girish,
Thanks for your reply. That's a problem I mentioned in the beginning.
Out of box code open the Purchase Order form but it opens as "Blank" (instead of with that PO# and this PO# does exist).
I am sure anyone can reproduce this issue if you follow:
Released Products / Select Product / Manage Inventory - Transactions / Purchase Order Link
Thanks.
Hi Ronak,
Seems the Number field is standard one which already has jump ref - Meaning it will navigate PurchTable form with the specific record.
Remove all your custom code and check whether its navigating to PurchTable form.
Thanks,
Girish S.
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156