update state via script

Gary22
Tera Contributor

hi all 

 

I am trying to update the status of a control ( sn_compliance_control) using a backend script . 

 

will "state.setValue('Attest')" work or do i need to find the number corresponding to each state of the control . If yes , how do i do that 

 

1 ACCEPTED SOLUTION

Basheer
Mega Sage

Hi @Gary22 ,

The syntax is wrong.

If you are writing this at client script you need to use something like this:

g_form.setValue("state","Attest"); //Attest being the value, if attest is not the value then enter the proper value

If you are writing this at server script you need to use something like this:

current.setValue("state","Attest");

or

grObj.setValue("state","Attest"); //grObj being the glide object

 

If you want to know the values of the state, open the form right click on state and click configure dictionary, scroll down to the choices you can find the values over there.

 

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.

View solution in original post

1 REPLY 1

Basheer
Mega Sage

Hi @Gary22 ,

The syntax is wrong.

If you are writing this at client script you need to use something like this:

g_form.setValue("state","Attest"); //Attest being the value, if attest is not the value then enter the proper value

If you are writing this at server script you need to use something like this:

current.setValue("state","Attest");

or

grObj.setValue("state","Attest"); //grObj being the glide object

 

If you want to know the values of the state, open the form right click on state and click configure dictionary, scroll down to the choices you can find the values over there.

 

Please hit like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

Cheers,
Mohammed Basheer Ahmed.