- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 12:04 PM
Hello Community,
I am trying to get a variable called "ritm_short_description" on the catalog item to populate the "short_description" field on the request item.
Here is the catalog item:
Here is the variable on the catalog item:
Here is how I would like it to be displayed as after the catalog item has been submitted and is now a request item:
I have been trying workflows and business rules and i am not sure what i am doing wrong.
Please help!
Thanks in advanced.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 03:43 PM
Did you try this in the workflow in the run script activity. This run script activity should be your first activity in the workflow. Or you could also write a before business rule on the sc_req_item table
Run script activity:
current.short_description=current.cat_item.short_description+' '+current.variables.ritm_short_description;
Business rule:
When: before insert
Conditions: Item is <select the catalog item>
Script:
current.short_description=current.cat_item.short_description+' '+current.variables.ritm_short_description;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 01:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 02:21 PM
Hello humblecommittedstudent, you have multiple options depending on what you actually want to do.
1) If you are just looking for the list view to show the cat item description, you can actually configure the list view and add the dot-walked field. You can just add cat_item.short_description. This way, even if the cat item short description is changed, it will always be showing the right description in the list against your req items.
2) If you want to denormalize the short description, then you simply have to have a BR on sc_req_item which just does
current.short_description = current.cat_item.short_description
There is no need to involve variables at all here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 02:30 PM
Nevermind, I understood your requirement. You want to concatenate the short_description from the Catalog Item and the value from a variable. So, you would do something like
if(current.short_description.indexOf(current.variables.special_variable) < 0) {
current.short_description = current.short_description+" "+current.variables.special_variable;
}
You want to make sure you are doing the concatenation only once and hence the check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 03:10 PM
Hello Siva,
I tried the code but I do not think I am able to get it working, am i doing something different?
Here is the code I have:
if(current.short_description.indexOf(current.variables.ritm_short_description) < 0) {
current.short_description = current.short_description+" "+current.variables.ritm_short_description;
}
ritm_short_description is from the rc_req_item table
and short_description is from the catalog_item table.
Thank you all for your assistance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2016 03:43 PM
Did you try this in the workflow in the run script activity. This run script activity should be your first activity in the workflow. Or you could also write a before business rule on the sc_req_item table
Run script activity:
current.short_description=current.cat_item.short_description+' '+current.variables.ritm_short_description;
Business rule:
When: before insert
Conditions: Item is <select the catalog item>
Script:
current.short_description=current.cat_item.short_description+' '+current.variables.ritm_short_description;