dear johanes , udah bisa di test ya
package :
PCMWFDEFBIZPROC (beforeSubmit) :
var isSubmit=1;var body=MinovaUtil.WORKFLOW.getViewBodyWorkflow();var formLeave=body.down('form[name=PDSWFMDLEAVENEW]').getForm();var absenceType=body.down('[name=AbsenceType]').getValue();MinovaUtil.ExecuteParamQuery({ID:"LeaveCheckDataOnGoing",stLeave:body.down('[name=StartDate]').getValue(),endLeave:body.down('[name=EndDate]').getValue(),empId:MinovaUtil.WORKFLOW.getEmpId(),regId:MinovaUtil.WORKFLOW.getRegId(),langId:MinovaUtil.GetLangID()},function(s){var result=Ext.decode(s.responseText);var dt=Ext.decode(Ext.decode(result.data));if(dt0.WarningType==='1'){MinovaMessageError("Error",dt0.WarningId,"");isSubmit=0;}},function(f){});MinovaUtil.ExecuteParamQuery({ID:"LeaveCheckAbsenceType",stLeave:body.down('[name=StartDate]').getValue(),endLeave:body.down('[name=EndDate]').getValue(),empId:MinovaUtil.WORKFLOW.getEmpId(),absenceType:absenceType,langId:MinovaUtil.GetLangID()},function(s){var result=Ext.decode(s.responseText);var dt=Ext.decode(Ext.decode(result.data));if(dt0.WarningType==='1'){MinovaMessageError("Error",dt0.WarningId,"");isSubmit=0;}},function(f){});if(quotaDeduction='Y'){MinovaUtil.ExecuteParamQuery({ID:"LeaveUpdateRemainingQuotaSave",empId:MinovaUtil.WORKFLOW.getEmpId(),startDate:body.down('[name=QuotaStartDate]').getValue(),endDate:body.down('[name=QuotaEndDate]').getValue(),startDate2:body.down('[name=QuotaStartDate2]').getValue(),endDate2:body.down('[name=QuotaEndDate2]').getValue(),quotaType:body.down('[name=AbsenceQuotaType]').getValue(),quotaTaken:body.down('[name=QuotaTaken]').getValue(),quotaTaken2:body.down('[name=QuotaTaken2]').getValue()},function(s){var result=Ext.decode(s.responseText);var dt=Ext.decode(Ext.decode(result.data));formLeave.setValues(dt0);},function(f){});} if(isSubmit===1){submit();}
dan custparam (LeaveCheckDataOnGoing) :
/*DECLARE @empId VARCHAR= '00000027' DECLARE @stLeave VARCHAR= '20170403' DECLARE @endLeave VARCHAR= '20170403' DECLARE @langId VARCHAR= 'IDN' DECLARE @regId VARCHAR='230'*/ DECLARE @WarningId VARCHAR= ( SELECT MessageId FROM dbo.SMESSAGECATALOG WHERE MessageId = 'TMLEAVEREQ' AND LangId = @langId ) DECLARE @data VARCHAR= ( SELECT COUNT FROM dbo.PCMWFRUNMAIN WHERE BizflowID = 'MD_LeaveNEW' AND EmpIDCreate = @empId AND (TaskStatusLast = 'W' OR WorkflowStatus = 'U') AND RegID <> @regId ) IF @data = '0' BEGIN SELECT '0' AS WarningType , '' AS WarningId END ELSE BEGIN SELECT '1' AS WarningType , @WarningId AS WarningId END
makasih