I added a menu function button to one of my forms, referring to the already existing menu-item 'ReqTransNetAction'
This button is in the action pane above the form.
This button is also on the EcoResProductDetailsExtended. When I click it here, it leads me to the net requirements of the item I clicked on.
However, when I click my button, I get the error: "item is missing".
I did check the properties for my menu button and they seem the same like the standard one on EcoResProductDetailsExtended.
Debugging shows the issue happens in the initFromCaller function of the ReqTransFormOverview class.
The issue is that the ReqCalc.argsItemId function call in here returns no itemId.
This code does the following:
if (args.dataset())
{
id = fieldName2id(args.dataset(),fieldStr(InventTable,ItemId));
if (id && args.record())
{
itemId = args.record().(id);
}
else if (id && args.lookupRecord())
{
itemId = args.lookupRecord().(id);
}
if (!itemId && args.caller())
{
callerForm = args.caller();
if (callerForm && callerForm.args() && callerForm.args().record() && callerForm.args().record().TableId)
{
id = fieldName2id(callerForm.args().record().TableId,fieldStr(InventTable,ItemId));
if (id)
{
itemId = callerForm.args().record().(id);
}
}
}
}
return itemId;
I am wondering, how can I add my datasource (or just the selected record in my table) to the menu-item so it is passed along as argument?
P.s. my code runs until callerForm && callerForm.args() && callerForm.args().record() && callerForm.args().record().TableId), to which it returns false.