- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:01 AM
Hi All,
I have to create a Single Workflow for Multiple Catalog Items.Kindly help me on fetching the Catalog Item Name on the IF condition so that it will trigger the corresponding Task
Example : ABCD Workflow
A,B,C,D--Seperate Catalog Items
Single workflow "ABCD Workflow" for all the A,B,C,D Catalog Items depends on the conditions.
If Catalog Items is A task should go the group W
If Catalog Items is B task should go the group X
If Catalog Items is C task should go the group Y
If Catalog Items is D task should go the group Z
I used the below script on IF condition,but it's not working.
answer = ifScript();
function ifScript() {
if(current.cat_item.getDispalyValue() == 'A'){
return 'yes';
}
else
return 'no';
}
Kindly Suggest..!!
Regards,
Sanitha
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:30 AM
Hi Sanitha,
I believe you are running the workflow at the RITM level.
So, here is how I would proceed.
Evaulate the combination and save it in the scratchpad variable as below.
runIt();
function runIt(){
var catItem = '';
if(current.cat_item.getDisplayValue() == 'A'){
catItem = 'A';
}
else if(current.cat_item.getDisplayValue() == 'B'){
catItem = 'B';
}
else if (current.cat_item.getDisplayValue() == 'C'){
catItem = 'C';
}
else{
catItem = 'D';
}
workflow.scratchpad.item = catItem;
}
Based on the value create a task either using activity or script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 02:19 AM
Glad that helped