How to get a variable value using GlideRecord
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2019 01:33 PM
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 ..
- 6,941 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2019 07:57 AM
Hi,
So you'd want to first query the table: sc_item_option_mtom
And addQuery for sc_item_option.item_option_new and use the sys id of the variable (you'd have to track this down)
If you wanted to further addQuery on the value...use sc_item_option.value (but I don't think you do)...you just want the value.
Once you get that query and inside while loop, nest additional query to sc_req_item
Use addQuery 'number' and gr.request_item.number (swap gr for your variable assigned to the sc_item_option_mtom query)
Now while loop that and get your values: gr.sc_item_option.value (again swap out gr for your sc_item_option_mtom gliderec variable)...
Technically, now that you're inside the RITM...you could go back to looking at variables now
gr2.variables.name_of_variable (gr2 is the nested gliderecord query on the sc_req_item table)
Hopefully you understand what I'm saying as I'm typing it in a pretty abbreviated and quick to the point way, but if you have any questions, let me know.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!