- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 07:58 PM - edited 01-30-2025 08:01 PM
Hi All,
How to print short description of record producer to the short description of target record in a Record producer.
Also want to print multiple variables value to the description of the target record one after another.
I tried the below script but still did not get the expected result :-
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 08:57 PM
short description of record producer means this?
If yes then you cannot access it using producer.short_description. You will have to hard-code it
current.short_description = 'Your Short Description \n' + 'Organization Name :-' + producer.organization_name + '\n' + 'Point of Contact at Third Party :-' + producer.point_of_contact_at_third_party;
If both the variables are reference type then use getDisplayValue() to get the display value rather than sysid
current.short_description = 'Your Short Description \n' + 'Organization Name :-' + producer.organization_name.getDisplayValue() + '\n' + 'Point of Contact at Third Party :-' + producer.point_of_contact_at_third_party.getDisplayValue();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 08:33 PM - edited 01-30-2025 08:37 PM
Hi @1_DipikaD
you take a try of following systax in producer script:
current.short_description = producer.short_description;
var description = "Variable2: " + producer.variables.variable1 + "\n"; description += "Variable2: " + producer.variables.variable2 + "\n";
current.description = description;
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 08:55 PM
It's giving javascript parse error on line 2. Also short description did not get printed . What if the variable is present in a variable set ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 10:40 PM
try the script I shared below
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2025 08:57 PM
short description of record producer means this?
If yes then you cannot access it using producer.short_description. You will have to hard-code it
current.short_description = 'Your Short Description \n' + 'Organization Name :-' + producer.organization_name + '\n' + 'Point of Contact at Third Party :-' + producer.point_of_contact_at_third_party;
If both the variables are reference type then use getDisplayValue() to get the display value rather than sysid
current.short_description = 'Your Short Description \n' + 'Organization Name :-' + producer.organization_name.getDisplayValue() + '\n' + 'Point of Contact at Third Party :-' + producer.point_of_contact_at_third_party.getDisplayValue();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader