Need help to auto populate field values from business rule

Shruthi1987
Tera Contributor

Hi,

I`m trying to create abusiness rule to auto populate below fields for an incident form using script.

Category (category): Security
Sub category (subcategory): Other  
Channel (contact_type): Event

 

Could you please help me how to auto-populate the values like security, other, and event using script?

 

Thanks & Regards,

Shruthi

1 ACCEPTED SOLUTION

dgarad
Giga Sage

Hi @Shruthi1987 

Please refer to below code.

current.category= 'security'; // back end name 
current.sub_category= 'other';
current.contact_type= 'event';

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

View solution in original post

5 REPLIES 5

Jitendra Diwak1
Kilo Sage

Hi @Shruthi1987,

 

If you are creating a business rule then it will be done when you save the form but you need the value value to be auto filled when the form is loaded. for this you need to create the onLoad client script with below code:

 

g_form.setValue('category','security');// second parameter should be backend value of choice
g_form.setValue('subcategory','Other');// second parameter should be backend value of choice
g_form.setValue('contact_type',event');// second parameter should be backend value of choice

 

Please mark this comment as Correct Answer/Helpful if it helped you.

 

Thanks

Jitendra

Please accept my solution if it works for and thumps up.