how to show RITM on Task form using related list

dilini
Giga Expert

I am trying to show related RITM on sc task form using related list, but not yet successful.

Applies to table:sc_task

Queries from table: sc_req_item

Screen Shot 2016-11-10 at 11.37.15 AM.png

7 REPLIES 7

Natsufab3
Kilo Guru

Hi Dilini,


    First go to system definitions=> relations and then create a new relation with RITM on task name and then applies to table will be 'Catalog task' and Queries from table will be 'Requested Item'



and this is the script


(function(){  


  current.addQuery("request", parent.request);


  current.addQuery("table_sys_id", parent.request_item.toString());


})();



Now save this relationship.



Go to service catalog => task and open the record and configure => related list and bring in RITM on task to right and save. This should show you your request item.



Thank you,


Please mark correct if applicable.


Your code give all requested items in the catalog order/cart. I need only requested item related to the task.


did you change anything in the code just copy that and paste it. It works fine with me wait let me share the screen shot of the code. Do not change the code it should work fine.relationship.png



Thank you


dilini
Giga Expert

Yes. Code work fine. Problem is that it gives all requested items in the catalog order/cart. I need only requested item related to the task. Tasks run on one requested item (RITM).



Screen Shot 2016-11-10 at 1.36.12 PM.png