- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 10:59 AM
Requirement:
When clicking the NEW button from Catalog Task related list on RITM......
- Copy the Short Description and Description field values from the current "active" Catalog Task to the NEW Catalog Task created after clicking the NEW button
- Make the Assignment Group field mandatory on the NEW Catalog Task record.
I created a an After BR (Insert,Update) on the Catalog Task table for the copy, but it's not working. Appreciate any help.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 02:51 PM
Hi
You need to write a Display Business Rule and an Onload Client script to achieve your requirement.
Display Business Rule
Table:-SCTASK
(function executeRule(current, previous /*null when async*/ ) {
g_scratchpad.shortdescription = current.request_item.cat_item.getDisplayValue();
gs.addInfoMessage("Item name:" + g_scratchpad.shortdescription); //comment this line once testing is done
})(current, previous);
OnLoad Client Script
function onLoad() {
if (!g_form.getValue('short_description') && g_form.isNewRecord()) {
g_form.setValue('short_description', g_scratchpad.shortdescription);
g_form.setMandatory('assignment_group', true);
}
}
Please mark my answer correct and helpful if this resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 11:46 AM
Great question and thanks for asking. Most of the Catalog Items generate only 1 Task, but there are some that do generate multiple Tasks, which would cause an issue since they would have different names.
Is there a way to write the Catalog Item name to the Short Description on the NEW Catalog Task? And is it possible to make the Assignment Group mandatory in the BR script for the NEW Task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 12:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 01:45 PM
Hi Palak,
I can't set the short description value on the NEW Task from the workflow (Advanced script) because I'm creating the Catalog Task manually from the RITM related list via NEW button, so need the BR script to set the value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 02:51 PM
Hi
You need to write a Display Business Rule and an Onload Client script to achieve your requirement.
Display Business Rule
Table:-SCTASK
(function executeRule(current, previous /*null when async*/ ) {
g_scratchpad.shortdescription = current.request_item.cat_item.getDisplayValue();
gs.addInfoMessage("Item name:" + g_scratchpad.shortdescription); //comment this line once testing is done
})(current, previous);
OnLoad Client Script
function onLoad() {
if (!g_form.getValue('short_description') && g_form.isNewRecord()) {
g_form.setValue('short_description', g_scratchpad.shortdescription);
g_form.setMandatory('assignment_group', true);
}
}
Please mark my answer correct and helpful if this resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 04:37 PM
Awesome! Thank you Palak. Works perfectly.