如何从扩展方法中的XppPrePostArgs中获取ARGS?

huangapple go评论99阅读模式
英文:

How to get ARGS from XppPrePostArgs in extension methos?

问题

我扩展了_main_类方法,我想从XppPrePostArgs在D365环境中获取Args

[PreHandlerFor(classStr(MYCLASS), staticMethodStr(MYCLASS, main))]
public static void MYCLASS_Pre_main(XppPrePostArgs args)
{
    // 如何将 args 转换为
    //   从 XppPrePostArgs 获取 Args
}
英文:

I extended the main class method, I would like to get from XppPrePostArgs the Args in D365 environment.

[PreHandlerFor(classStr(MYCLASS), staticMethodStr(MYCLASS, main))]
public static void MYCLASS_Pre_main(XppPrePostArgs args)
{
     // HOW TO CONVERT args to 
    //   from XppPrePostArgs  get Args
}

Thanks.

答案1

得分: 2

你并没有按传统的继承方式进行任何转换。你正在使用XppPrePostArgs来获取事件的变量。

// 将"_args"更改为参数变量的名称
Args args = _xppPrePostArgs.getArg("_args");

英文:

You're not converting anything in the traditional inheritance sense. You're using XppPrePostArgs to obtain the event's variable(s).

// Change "_args" to whatever the argument variable name is

Args args = _xppPrePostArgs.getArg("_args");

huangapple
  • 本文由 发表于 2023年7月24日 17:40:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76753195.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定