How to tell what module has called the program
When using [Dynamics] [AX] is there a system function that can be used to determine which module the user was in开发者_运维问答 when the program was called? I want to execute different X++ lookup code for employee, for the ProjJournalTable form, but this would be a different employee-list depending on which module is calling the form. Hope that's clear! - Maeve
There is no concept of "module" in the execution context of a form or report. Therefore there is no system function to return that.
How to get around context dependant behaviour, where the behaviour depends on the caller?
The usual method in say a lookup form is to inspect element.args()
for one of:
element.args().dataset()
and/orelement.args().record()
element.args().parmEnumType()
andelement.args().parmEnum()
element.args().parm()
element.args().caller()
element.args().parmObject()
Take a look on the form LedgerAccountLookup
for example, you can find many more by searching for "args" in form methods named "init".
精彩评论