Copy Description from Catalog Item to RITM

tiyasa
Giga Expert

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();

      }

1 ACCEPTED SOLUTION

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.


View solution in original post

9 REPLIES 9

leeryan
Giga Contributor

I think the issue may be that current.short_description is the RITM, not the Catalog Item. Not sure, but I would try replacing:


gr.description = current.short_description;  


with:


gr.description = current.cat_item.short_description;



Edit: since your latest post identifying it's actually the description field you are after, I'm wondering if the fact it's a HTML field will be an issue. See: GlideRecord HTML field to Plain Text


Thanks. Just tried and didn't work


leeryan
Giga Contributor

Perhaps get from the variable instead of current..?


gr.description = gr.cat_item.short_description;


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.


tiyasa
Giga Expert

Oh my Bad , sorry. Copying Short_Description of the Catalog form to RITM Detailed Description