How to get a variable value using GlideRecord

ragz
Tera Expert

Hi ,

One of my catalog item has a startDate variable value  .

How to get the value using Glide scripts  from sc_item_option_mtom and req table ?

I need this script for scheduler .. Based on the startdate Need to send the remainders ..

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

You can query sc_req_item table for that. For ex

 

var item = new GlideRecord('sc_req_item');

item.addQuery('cat_item','<sys id of the catalog item>');

item.query();

 

while (item.next())

{

if (item.variables.startDate == GlideDateTime()).getLocalDate())

{

//Trigger the email for reminders

}

}


Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv ,

 

How to get a sys ID for the catalog item ?

item.addQuery('cat_item','<sys id of the catalog item>');

Open the catalog item, where you have the start date variable. Copy the SysID by right clicking the header bar to copy the sysid.


Please mark this response as correct or helpful if it assisted you with your question.

I am not looking for a single record . I need all the records to check as I am using the script for my scheduler .

So scheduler script  has to look all the RITM records and find the startDate variable to send out the remainders based on the startDate.