Args对象未初始化AX 2012

时间:2017-04-11 08:28:19

标签: axapta dynamics-ax-2012

这是我的代码:

static void main(Args args)
{
    LedgerJournalId ledgerJournalId;
    HSinvoiceAcknowledgement hSinvoiceAcknowledgement = new HSinvoiceAcknowledgement();

    if (classidget(args.caller()) == classnum(syssetupformrun))
    {
        if (formhasmethod(args.caller(), identifierstr(HSjournalnum)))
        {
            ledgerjournalid = args.caller().HSjournalnum();
        }
    }

    if(ledgerJournalId)
    {
        hSinvoiceAcknowledgement.parmJournalNum(ledgerJournalId);
    }
    if (hSinvoiceAcknowledgement.prompt())
    {
        hSinvoiceAcknowledgement.run();
    }
}

我的main方法中有 Args args 参数,但是它表示

  

Args对象未初始化

可能出错?

1 个答案:

答案 0 :(得分:1)

只需添加一项额外检查即可确保{ "mob_type": "$input.params('type')" "filename": "$input.params('filename')" "assertion": "$input.params('assertion')" } 不为空。替换

args

if (classidget(args.caller()) == classnum(syssetupformrun))