- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 08:41 AM
Hello everyone,
I need to copy the Description field on the Catalog Item form to the related RITM. I tried to write a BR after insert on the Catalog Item table
but it does not do any good.
Any help is appreciated.
Thanks in advance.
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.request_item);
gr.query();
if(gr.next()){
gr.description = current.short_description;
gr.update();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 09:12 AM
This did not work yet.
But , I found an alternative approach for my requirement, although it is not perfectly what it should be.Just a workaround.
I found the short description of the catalog is mapped to short description of the RITM, so i remapped this (from RITM) to the detailed description of the RITM in a run script of the workflow of the SC instead of the BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 08:46 AM
Just making sure...
The description is on the Catalog Item... we're not talking about a description field on the form that the Catalog Item has when executed, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 08:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 09:21 AM
Ok. I *think* what you're trying to do is grab the Catalog Item's description whenever a Request Item (the result of a Catalog Item) is created. If that's the case, you're not building in the right place. You need to capture at time of Request Item creation, not Catalog Item.
What I'd do is place a runscript in the Workflow your Catalog Item triggers. Within that runscript activity I'd place the following:
current.short_description = current.cat_item.short_description;
Though from a business perspective I'd recommend against this approach. Usually you want your RITM short descriptions to have some info specific to this particular instance of the request. The Catalog Item's short description is easily retrievable by dot walking up the RITM's reference to Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2016 09:26 AM
Thanks Robert. That is exactly what I was trying to achieve. And sorry, in the below answer of mine where I used alternate approach, that's exactly what i did. Got rid of the BR and put a script in the WF.