- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 01:53 AM
How to pre-populate description field on incident form on change of vendor company.
Pre text would be - Name,Actions,Root Cause etc.
Regards,
Viraj
Solved! Go to Solution.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 02:32 AM
Hello Viraj,
Write onChange client on your company field and in that add this code
if(newValue == "yoir_company") {
var desc = "Name: \nActions: \nRootCause: \n";
g_form.setValue("Description",desc);
}
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 12:13 AM
Hi Asif,
Thanks for the response that worked for me
Regards,
Viraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2024 11:30 AM
But it was showing read only I want to update or edit the form so how we can achieve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 02:35 AM
Hi Viraj,
please refer script mentioned by asif.
Do let us know if more help required.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 02:38 AM
Hi Viraj,
Use on an onChange client script based on 'Vendor' field as below:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var description = "Name: \nActions: \nRoot Cause: \n";
g_form.setValue("Description", description);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2020 03:19 AM
Hey viraj,
To prepopulate description field on incident form you have to create onChange() client script with where om change of vendor company and for pretext just check out below link, might help you
kindly mark Correct and Helpful if applicable.
Regards,
Indrajit.