Args 对象未初始化 AX 2012
Args object not initialized 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();
}
}
我的主要方法中有 Args args 参数,但是它说
Args object not initialized
有什么问题吗?
只需添加额外的检查以确保 args
不为空。替换
if (classidget(args.caller()) == classnum(syssetupformrun))
和
if (args &&
args.caller() &&
classidget(args.caller()) == classnum(syssetupformrun))
这是我的代码:
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();
}
}
我的主要方法中有 Args args 参数,但是它说
Args object not initialized
有什么问题吗?
只需添加额外的检查以确保 args
不为空。替换
if (classidget(args.caller()) == classnum(syssetupformrun))
和
if (args &&
args.caller() &&
classidget(args.caller()) == classnum(syssetupformrun))