没有为数据协定对象定义元数据类

时间:2018-03-05 11:57:32

标签: axapta dynamics-ax-2012 x++ dynamics-ax-2012-r2 dynamics-ax-2012-r3

我正在尝试创建批处理作业。最初,我创建了一个类并添加了一个方法。现在我将此类附加到Action Menu项。并生成增量CIL。但是,当我打开菜单项时,我得到了错误。波纹管是我的代码和相关的屏幕截图。

 [DataContractAttribute]
class BatchJobDemoClass
{
}

[DataContractAttribute]
public void xmlGeneration(Args _args)
{
XmlDocument doc;
XmlElement nodeXml;
XmlElement nodeTable;
XmlElement nodeAccount;
XmlElement nodeName;
CustTable custTable;
#define.filename(@'C:\\Users\user\Desktop\productsXML.xml')
;
doc = XmlDocument::newBlank();
nodeXml = doc.createElement('xml');

doc.appendChild(nodeXml);
//Determines the runtime
if (xSession::isCLRSession())
{
info('Running in a CLR session.');
}
else
{
info('Running in an interpreter session.');

//Determines the tier
if (isRunningOnServer())
{
info('Running on the AOS.');
}
else
{
info('Running on the Client.');
}
}

while select custTable
{
nodeTable = doc.createElement(tablestr(CustTable));
nodeTable.setAttribute(fieldstr(CustTable, RecId),int2str(custTable.RecId));
nodeXml.appendChild(nodeTable);
nodeAccount = doc.createElement(fieldstr(CustTable, AccountNum));
nodeAccount.appendChild(doc.createTextNode(custTable.AccountNum));
nodeTable.appendChild(nodeAccount);
nodeName = doc.createElement(fieldstr(CustTable,CustGroup));
nodeName.appendChild(doc.createTextNode(custTable.CustGroup));
nodeTable.appendChild(nodeName);
}
doc.save(#filename);
info(strFmt("File %1 created.", #filename));
}

Action Menu Item Properties Of Menu Item Error While Opening It

0 个答案:

没有答案