Announcements
Hi All,
I am trying to open a form by giving a specific record but the form opened with all the records.
I debugged the process .The record getting selected, but form not opening with the specified record.
Please guide me on this.
Thanks.
IITProbationEvaluationHeader _iitProbationEvaluationHeader; MenuFunction mf; Args args1 = new Args(); Formrun formrun; _iitProbationEvaluationHeader =IITProbationEvaluationHeader::find("STF-0698"); args1.name(formStr(iiTPerformanceEvaluationAssignToListPage)); args1.record(_iitProbationEvaluationHeader); formrun = ClassFactory.formRunClass(args1); formrun.init(); formrun.run(); formrun.wait();
Thank you so much Matin.
Its Working.
As I said, use this.listPage().listPageArgs() to get the arguments. Then call externalRecord() method to get the record. For example:
ListPageArgs args = this.listPage().listPageArgs(); ProbationEvaluationHeader evaluationHeader = args.externalRecord() as ProbationEvaluationHeader;
Thanks for the reply Martin,
I am calling the menuitem in drillDown method
In interaction class,
This if condition get satisfied and all records for the particular user eecuted.
But i need the form should opened with the particular record which i am passing in drilldown method (args.record()).
So i am thinking if i can pass the recid from the drillDown method and get it in interation class then i can add additional condiotion in IF statement and execute the logic.
Could you help me how to pass the args.record(table) and get it in interaction class.
Thanks.
I see you original didn't tell us a lot of important information.
Regarding "I tried using args but there is no main method in interaction class", you're wrong in thinking that Args are used only in main() method. Forms don't have main() method either and yet they can receive and use Args. You can call in this.args() to get the object. And in a listpage interaction class, you can use this.listPage().listPageArgs().
Thanks Martin and Girish for your reply.
There are two customized form.
1.Permance for all users.
2.Performance assigned for particular user.
Notification -> Go to Orgin button.
My task is that when i click on the Go to Orgin, it should open a form ( customized form i.e: performance assigned to the particular user.)
But now when i click on the Go to orgin it shows all records (performance assigned for all user).
So i have written code in the EventContextDrillDown class, drill down method,
Now i can open the form which i need.
But i need only one record for which the preformance is evaluated.
I gone through the code in iiTPerformanceEvaluationAssignToListPage (code has been written to show the performs related to the particular user )
So i am getting all the records fr the particular user .
Now my question is how to pass value from EventContextDrillDown class and iiTPerformanceEvaluationAssignToListPage (interaction class) .
1.I tried using args but there is no main method in interaction class.
2. i created some method in interaction class and try to call the method in EventContextDrillDown .But not able to do . Throwing error."cant create method of listPageInteraction class in non interaction class".
Could you help me how to pass value from EventContextDrillDown class ->drill down method to iiTPerformanceEvaluationAssignToListPage (list page interaction class) method.
Thanks.
As Girish mentioned, it should work automatically if there is a table relation defined.
But even if it's the case, the form may contain code that breaks the standard logic (either intentionally or by mistake).
Hi PJ John Paul,
If you have proper relation it will open automatically against the caller record.
Other way will be getting the caller record.
On the called form you need to get the caller record.
After getting the caller record you need to set the range in the executeQuery method of datasource.
Refer to the below link for explanation.
https://dynamics365musings.com/call-a-form-from-another-form/
Thanks,
Girish S.
André Arnaud de Cal...
294,233
Super User 2025 Season 1
Martin Dráb
232,982
Most Valuable Professional
nmaenpaa
101,158
Moderator