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.
Please help me.
Why can’t you just get the master record by a foreign key on the details record?
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.
Doesnt element.args().record() return you the selected record from the Master form?
element.args().record() return me the detail table. Not master form.
Correct me If I am wrong,
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
//set an enum value
//set an object
//call the menu item with args