Hi,
I am creating timesheet records through the user event script but in the script throw invalid field value project task but is closed.
var timeRecord= record.create({type:'timebill',isDynamic: true});
if(employee!=''&&employee!=null){
timeRecord.setValue({fieldId: 'employee',value:employee});}
if(travetime!=''&&travetime!=null){
timeRecord.setValue({fieldId: 'hours',value:travetime});}
if(trandate!=''&&trandate!=null){
timeRecord.setValue({fieldId: 'trandate',value:trandate});}
if(loc!=''&&loc!=null){
timeRecord.setValue({fieldId: 'location',value:loc});}
if(customer!=''&&customer!=null){
timeRecord.setValue({fieldId: 'customer',value:customer});}
if(cls!=''&&cls!=null){
timeRecord.setValue({fieldId: 'class',value:cls});}
if(casetask!=''||casetask!=null){
timeRecord.setValue({fieldId: 'casetaskevent',value:casetask});
}
timeRecord.setValue({fieldId: 'item',value:25});
timeRecord.setValue({fieldId: 'memo',value:'Travel Time'});
var createTime=timeRecord.save({enableSourcing: false,ignoreMandatoryFields : true});
log.debug("create trave time record id",createTime);
error is being thrown when the project task and project closed.
error is being thrown when the project task is not assigned to the employee
But in same code working the for the project task open and the project is assigned to the employee
note that when trying to do the same with the create the timesheet through UI but in script thrown " invalid field value"
Please help me any one