- 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
is this a dictionary field on RITM table or variable associated to your catalog item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Sorry for the confusion @Ankur Bawiskar . It is a catalog variable.
- 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
Thank you very much @Ankur Bawiskar for your time . But I have been asked to create functionality on catalog item itself. Not allowed to write any script on RITM or Catalog Task.
Can we achieve that way only writing script on catalog item?
Thank you