Get values from template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 02:36 AM
Hi
we have a requirement to update the template values through the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:36 AM
Hi Naveen,
Thanks for your reply,
with your script, one more field value(state is InProgress) is adding like below.
But, my requirement is, I want to make the state value from InProgress(2) to pending(3) for this template.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:44 AM
Change your choice as per your requirement like "state=3"
Regards,
Naveen G N
please mark correct if you find it correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:50 AM
Hi Naveen,
let assume i have one template which has already created in sys_template table with values like below.
Now I want to change the state & channel from phone & pending respectively.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:08 AM - edited 02-08-2024 04:08 AM
Hi @Vinay49
Can you try with the below code :
var grTemplate = new GlideRecord('sys_template');
grTemplate.addQuery('sys_id','56e62ccbc611227500adb083f968a484'); // Replace with Sys_id of your template record
grTemplate.query();
if(grTemplate._next())
{
grTemplate.auto_provisioning_user= 'true'; // Change the field name as per your field
grTemplate.update_user_record_upon_each_login = 'true'; // Change the field name as per your field
grTemplate.update();
}
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:14 AM
Hi Amit,
Thanks for the update. It is not working