- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 04:32 AM
Hi All,
We have a custom table called u_email_client and here we have a filed called u_status.
The requirement is whenever the insert is happening that time it should be set u_status choice list to Received(this Received choice list option is already available we need to utilize the same).
How we can achieve this?
i tried below script in rest API but not working
var emailClient = new GlideRecord('u_email_client');
emailClient.initialize();
emailClient.u_subject = short_description;
emailClient.u_status ="ed2ee3a3376aba0021865ca543990e5a";//sys id of choice list "Received"
emailClient.u_item = num2;
emailClient.insert();
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 04:38 AM
Hi,
it's choice and not reference so give value
var emailClient = new GlideRecord('u_email_client');
emailClient.initialize();
emailClient.u_subject = short_description;
emailClient.u_status ="Received"; // give choice value here
emailClient.u_item = num2;
emailClient.insert();
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
08-22-2022 04:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 04:38 AM
Hi,
it's choice and not reference so give value
var emailClient = new GlideRecord('u_email_client');
emailClient.initialize();
emailClient.u_subject = short_description;
emailClient.u_status ="Received"; // give choice value here
emailClient.u_item = num2;
emailClient.insert();
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
08-22-2022 04:45 AM
Thanks Ankur. I tried the same initially but the spell was wrong.