private IdentifierName getCallerName() { Object caller; SysDictClass sysDictClass; IdentifierName callerName; // There must be a caller to retrieve a name if (!(element.args() && element.args().caller())) return callerName; caller = element.args().caller(); sysDictClass = new SysDictClass(classIdGet(caller)); // Use reflection & recursion to get the name if possible while (sysDictClass) { if (sysDictClass.hasObjectMethod(identifierStr(Name))) { callerName = caller.name(); sysDictClass = null; } else if (sysDictClass.extend()) { sysDictClass = new sysDictClass(sysDictClass.extend()); } else { sysDictClass = null; } } return callerName; }
This technical blog will be about my adventures with Microsoft Dynamics 365 for Operations (AX7/D3fo), AX 2012, and AX 2009.
Tuesday, October 23, 2018
Fun and better method to get Args.Caller() name
In any AX/D365 environment, there's often a need to get the Args.Caller().Name(), except not all possible caller's will have a .name() method, so here's a little function that can be added to a form to get the caller's name in a more proper method.
Subscribe to:
Post Comments (Atom)
This method can be really effective. I will consider trying it out. Okay?
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteAll things considered splendid diagram. I absolutely love this site. Much appreciated!kissasian alternatives
ReplyDeleteAs an AI language model, I'm not sure what "Args" refer to. However, in general, fun and better methods to achieve a goal can be more effective and engaging. Gamification, rewards, and challenges are some techniques that can be used to make the process more enjoyable and motivating. Need you can follow Virtual magician and learn new things about magic. It's important to find a balance between fun and productivity to ensure that the desired outcomes are achieved without sacrificing the quality or efficiency of the process.
ReplyDeleteThe piece is impressive because of its well-researched information and good phrasing. I was so engrossed in this content that I couldn't put it down. I am amazed by your effort and skill. Thank you very much. erp customer service
ReplyDelete