How to show or hide workflow action based on field value(not

Posted by Sudhakar on 26-Feb-2014 17:20

Hi all,

i have one field named as "city" and 2 workflow actions named as "assign city" and "change city"

i need to display workflow action based on "city" values

i.e when the city value is null i need to display "assign city" workflow action in the page

if the city value is not null then i need to display the "change city"  workflow action in the page

can any one help me out to achieve this..

Thanks,

Sudhakar..

All Replies

Posted by cgontla1 on 27-Feb-2014 05:22

Hi SudhakarN,

We can show  or hide workflow action based on field value by configuring formula condition inside workflow action.

Say for example,

-> Create a trigger of type 'Update Field Value where write code in 'Formula area' to set the value (Ex: rbv_api.setFieldValue("emp", {!id}, "city","Hyd");

-> Create a workflow status of type 'Change workflow status' where select previously created trigger and write formula to enable workflow action when city is null (Ex: var a = rbv_api.getFieldValue("emp", {!id}, "city");

if(a == null)

{

return true;

}

In this way, you can create one more action 'Change City' as well.

Please let me know if you have any questions.

Posted by Sudhakar on 27-Feb-2014 11:47

thank you [mention:f514dfda5fac4125be52e714283cfa04:e9ed411860ed4f2ba0265705b8793d05] ..

Posted by Sudhakar on 27-Feb-2014 16:09

No need to write the trigger [mention:f514dfda5fac4125be52e714283cfa04:e9ed411860ed4f2ba0265705b8793d05]

FYI...

simply adding the following code in workflow action condition formula is fine

if ("{!city}"!="")

{

return true;

}

if above formula returns true then only this workflow action is visible in the page

Posted by cgontla1 on 03-Mar-2014 05:10

Hi SudhakarN,

If you want to update field value ('city' field) using that workflow action then you have to have a trigger otherwise its not

needed.

Posted by Sudhakar on 03-Mar-2014 11:17

Ya your right [mention:f514dfda5fac4125be52e714283cfa04:e9ed411860ed4f2ba0265705b8793d05] ,

But in my requirement i do not want to change field values('City'),i want to show or hide workflow actions based on city values,So the above post is works fine for me...

This thread is closed