- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited Friday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
there is a field on RITM table order_guide
When RITM is generated as part of Order guide this field is populated, so you can use that logic with g_scratchpad variable
1) use Display business rule on RITM and SC Task table
BR on RITM
(function executeRule(current, previous /*null when async*/) {
// Add your code here
g_scratchpad.orderGuide = current.order_guide.toString();
})(current, previous);
BR on SC TASK
(function executeRule(current, previous /*null when async*/) {
// Add your code here
g_scratchpad.orderGuide = current.request_item.order_guide.toString();
})(current, previous);
2) then normal onLoad client script on sc_req_item and sc_task and Not Catalog client script
function onLoad() {
if (g_scratchpad.orderGuide != '') {
g_form.setDisplay('variables.variableName', true); // give your variable name here
} else {
g_form.setDisplay('variables.variableName', false); // give your variable name here
}
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
catalog client scripts don't have access to g_scratchpad variable
another way
1) create onLoad catalog client script which Applies on RITM and SC task
2) grab the RITM sysId using g_form.getUniqueValue()
3) do GlideAjax and see if order_guide field is populated or not
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏