how to move Hr Case to draft state

showsid02
Tera Contributor

i have build a custom table "hr_case" with some custom fields.in state filed i have "draft" state.

 

 

once i click "submit" button with mandatory fields in the form it will move me to "draft" state.

 

showsid02_1-1692279846316.png

 

How can i achieve this please suggest.

 

3 REPLIES 3

Samaksh Wani
Giga Sage
Giga Sage

Hello @showsid02 

 

Can you check your question once again, you mention it is draft stat, you need to move it to draft.

 

Quite Confusing.

state is a choice field having 1,draft 2.ready 3 work in progress and so on.

 

So once i submit the form with clicking submit button it set state to "draft".

 

this is my requirement.

 

Please suggest

Hello @showsid02 

 

You need to write a onSubmit() Client Script :-

 

 

function onSubmit(){

g_form.setValue('state', 'backend_value_of_draft');

}

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh