I am quite new to workflows and I faced following issue while trying out workflows.
I have implemented 2 workflows for mandatory field check on 2 fields during the creation and the update of a record.
Field 1 - Expiration Date
The Expiration Date is checked if it is null, and if so an error is displayed.
The two javascripts written for the validations are,
- execution.getVariable('ExpirationDate') == null
- execution.getVariable('ExpirationDate') == ''
Field 2 - Salesman Code
The Salesman Code is checked if it is null, and if so an error is displayed.
the three javascript scripts written for the validations are,
- execution.getVariable('SalesmanCode') == null
- execution.getVariable('SalesmanCode') == ''
- execution.getVariable('SalesmanCode') == ""
Both workflows are triggered during the creation and update of the record.
Now the problem is, When I try to update a record that has a SalesmanCode but no Expiration Date, it still triggers the workflow for SalesmanCode and gives the error as Salesperson is Mandatory which is wrong.
Could you help me figure out what could be the reason for this?