我正在尝试创建批处理作业。最初,我创建了一个类并添加了一个方法。现在我将此类附加到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));
}