I have a form in which the first frame is the master table, and the second frame is details table. In details frame I have a button for displaying selected value in a details datasource, in the original form of the details’ table. But also, I need to pass value of the selected master record at the same time.
What do I need to use? args.caller() object? or something else.
It is Axapta Original table and unfortunately it is a bit complicated.
It is activity table in the CRM module. Its relation with other tables like BusinessRelation,ContactPerson etc. is established with other table that is smmActivityParentLinkTable.
So, I just can not get the master record by a foreign key on the details record.
I am not able to take smmActivityParentLinkTable I tried but it does not work. Although the ds of smmActivityParentLinkTable exists in my form , it is not passed as an args.
I do not know how to use this way. I have the datasource in the form but I do not use anywhere. It just joined by my Table that is actually the master table.
I have used element.args().record() but it did not work. I am not sure it works, since it is also using args. Isn’t it?
Well, I’m not sure how much do you know about Args…
You can define which data source is passed to the menu item by setting DataSource property on the menu item button.
If this is not a solution for any reason, you need to build and pass Args by yourself. Typically, overwrite the clicked() method and place code like this into it:
Args args = new Args();
MenuFunction menuFunction = this.menuFunction();
;
//set a record
args.record(smmActivities);
//set an enum value
args.parmEnumType(enumNum(smmActivityParentType));
args.parmEnum(smmActivityParentLinkTable.ParentType);
//set an object
args.parmObject(element);
//call the menu item with args
menuFunction.run(args);