Solved

Workflow is triggered where it should not

  • 19 July 2023
  • 3 replies
  • 102 views

Badge +4
  • Do Gooder (Partner)
  • 6 replies

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,

  1. execution.getVariable('ExpirationDate') == null
  2. 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,

  1. execution.getVariable('SalesmanCode') == null
  2. execution.getVariable('SalesmanCode') == ''
  3. 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?

icon

Best answer by YashP 20 July 2023, 11:59

View original

3 replies

Userlevel 4
Badge +7

Hi @YashP,

If you disable the Expiration Date workflow for a bit and let only the Salesman Code workflow trigger do you still get the same error or is it different?

/Lahirumala

Badge +4

Hi @Lahirumala de Mel 

Yes, I get the same issue even after disabling expiration date validation.

 

/Yashodha

Badge +4

Hi,

 

I was able to solve the issue by adding a IFS Projection task before the gateway.

 

 

From the task, I read the record I want to update and then pass it through the gateway to check the null value.

 

Thought this might help.

/Yashodha

Reply