ax 2012批处理不运行问题
最近在开发12的批处理,但是很奇怪所有的都配置好了就是不跑批处理,假如你也出现了那用下面的方法试试:
12的批处理和09不一样,不是运行x++代码,而且运行你CIL生成的DLL文件,
1.你必须让你的批处理运行在服务器端(假如是设置定时跑,不是手动运行批处理的话),方法如下,
public boolean runsImpersonated()
{
return true;
}
2.你在批处理里面调用系统的类,必须也是运行在服务器端,例如假如调用过账类
server static PurchFormLetter cec_construct(
DocumentStatus _document,
IdentifierName _className = '',
IdentifierName _methodName = '',
SysOperationExecutionMode _executionMode = SysOperationExecutionMode::Synchronous,
MenuItemNameAction _callerMenuItem = '')
{
***和系统相同
}
{
purchFormLetter = PurchFormLetter::cec_construct(DocumentStatus::PackingSlip);
purchFormLetter.update(purchTable,
packingSlipId,
str2Date(cec_purchTable.ShippingDateRequested, 321),
PurchUpdate::ReceiveNow,
AccountOrder::None,
Noyes::No,
NoYes::No);
}
3.批处理写好之后,必须运行编译.NET Framework CIL,如下:
4.运行批处理的用户设置必须如下:
这样就可以运行批处理了。