How to reset the choice value to --None--?

Snehal2
Kilo Guru

Hi Developers,

I have a choice field Result(Dropdown with  --None--) with three choices(A,B,C) which are being set after a incident is resolved based on certain condition through script(Business Rule)

If the incident is reopened then the field Result should be cleared/reset back to  --None--.

Can any one help me out?

1 ACCEPTED SOLUTION

Daniele Songini
Tera Guru

Hi,

creates a BR before update that is executed when the state changes from resolved to open (or other states that interest you).

current.fieldName = '';

 

find_real_file.png

 

find_real_file.png

Please mark this as "Correct Answer" if I have given you a sufficient answer to your question.

Best Regards,
Daniele

View solution in original post

8 REPLIES 8

Hi Daniele,

How can we achieve this through run script in workflow.

After if condition in workflow in run script clear the value of a choice field.

If your workflow is attached on the same wher your choice field is available then in run script you can add the same code given by daniel,

if(STATE_CONDTION){

current.fieldName = '';

}

Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

Andy Hopper
Tera Contributor

For anyone who finds this post first in future (like I did)...

This method won't work when using GlideRecord with updateMultiple().

e.g. the following won't work...

gr.setValue('fieldName', '');
gr.updateMultiple();

You need to use...

gr.setValue('fieldName', 'NULL');
gr.updateMultiple();

 

Thank you Andy Hopper!

This was exactly what I needed.