我正在自定义 Anywhere(7.5.2)-WorkExecution。我正在尝试在工作日志执行上创建一个动态列表,但它总是只创建一个。请帮忙。
文件:WorkLogHandler.js 功能:_saveTransaction
现有代码:
_saveTransaction: function(){
try{
var workOrderSet = CommonHandler._getAdditionalResource(this,"workOrder");
var workOrder = workOrderSet.getCurrentRecord();
if (!workOrder.isNew()) {
ModelService.save(workOrderSet);
}
this.ui.hideCurrentView();
}catch(e){
throw e;
}
},
新代码:
_saveTransaction: function(){
debugger;
try{
var workOrderSet = CommonHandler._getAdditionalResource(this,"workOrder");
var workLogdata = CommonHandler._getAdditionalResource(this,'workOrder.workloglist').getCurrentRecord();
var workOrder = workOrderSet.getCurrentRecord();
debugger;
for(var i=0; i<2; i++){
debugger;
if (!workOrder.isNew()) {
debugger;
workLogdata.set('summary',i+" Round");
}
ModelService.save(workLogdata);
this.ui.hideCurrentView();
}
return;
}catch(e){
throw e;
}
},