How to add dynamic Encoded query in below script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2023 05:01 AM
Hi All,
please help me with below requirement
I am create fix script and I want to add dynamic query in the encoded query please let me how how to add I have written the script below.
var serNum = 1;
var ab = new GlideRecord('x_upl2_mx_digitize_experiment');
ab.orderBy('number');
ab.query();
if (ab.next()) {
var xy = new GlideRecord('x_upl2_mx_digitize_sample_and_analysis');
xy.addEncodedQuery('experiment_number='++ ab)
Thanks & Regards
KP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2023 05:25 AM
experiment_number is reference field?
If yes then try this
xy.addEncodedQuery('experiment_number='+ab.getUniqueValue());
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