- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 11:32 PM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 11:39 PM
Hi @Shruthi1987
Please refer to below code.
current.category= 'security'; // back end name
current.sub_category= 'other';
current.contact_type= 'event';
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 11:50 PM
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