Where is related list data stored?

danmadzia
Tera Contributor

Here is the scenario:

In Stories, in the Related Links area, I have some related lists: Affected CI's, Change Requests, etc.

I can do the usual Edit or New to add records to - lets use Change Request for example.   No problem.

I have created a UI action to Create a Change Request from Story which works just fine.  

The problem is: How do I add the change request number (or sys_id) to the Change Requests Related List in my UI Action script?

I cannot find where that data is stored.

Thanks!

Dan

1 ACCEPTED SOLUTION

  var changeRequest = ChangeRequest.newNormal();


  changeRequest.setValue("short_description", current.short_description);


  changeRequest.setValue("description", current.description);


  changeRequest.setValue("cmdb_ci", current.cmdb_ci);


  changeRequest.setValue("priority", current.priority);


  changeRequest.setValue("sys_domain", current.sys_domain);


  changeRequest.setValue("company", current.company);


  changeRequest.setValue("parent", current.sys_id);   // Adds to related records


  changeRequest.insert();



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


View solution in original post

10 REPLIES 10

Thanks for the information.   The code did not work as id comes back as undefined.   I did some tweaking though and I was able to get this to work:



  changeRequest.insert();



  current.rfc = changeRequest.getGlideRecord().getUniqueValue();


  current.parent = changeRequest.getValue("sys_id");


  current.update();



Thanks for all of your help.   I really appreciate it.