Changing state on the basis of additional comments

shivashish
Tera Contributor

Hi Everyone,

 

I have one requirement if the end user is updating the additional comments.

State of the form should change.

In my use case I have state:- 1: Analysis, 2: pending review, 3: Additional information required,  4: many more

 > End user would be updating the additional comments when the state of the form would be "Additional information required"

> After the user will add the additional comments, state of the form should automatically change to "Pending Review".

 

Please help me to suggest the solution with code.

2 ACCEPTED SOLUTIONS

Imran1
Giga Guru

Hi Shiva,

 

Could you please try the below script in BR (on before)

if(current.comments.changes() && current.state = "Additional information required"){
current.setValue('state',"Pending Review");
}

 

It should work

 

Regards,

Imran

 

View solution in original post

Slava Savitsky
Giga Sage
4 REPLIES 4

Imran1
Giga Guru

Hi Shiva,

 

Could you please try the below script in BR (on before)

if(current.comments.changes() && current.state = "Additional information required"){
current.setValue('state',"Pending Review");
}

 

It should work

 

Regards,

Imran

 

Hi Imran, 

 

Thanks it's working fine as expected.

Glad to know it worked for you. 

One thing if you remember while working on any scripting requirement is that  - there could be multiple ways to script to reach a solution. Trying different approaches and picking the right one for your scenario is what that matters

 

Regards,

Imran

Slava Savitsky
Giga Sage

What is your definition of an "end user"?