Is there a way to populate data from a related list into the current form?

kenduong
Kilo Contributor


Hi All,

I am trying to populate data from the related list remediation into the risk form. I want to see the complete view of risk and remediation on the same view.

1 ACCEPTED SOLUTION

Hi Ken



Use this, i hope this works



After


update/ insert


table - grc_remediation



condition


current.risk!=''



gs.addInfoMessage('started');


var gr=new GlideRecord('grc_risk')


gr.addQuery('sys_id', current.parent);


gr.query()


if(gr.next())


{


gs.addInfoMessage('Came here');


gr.u_risk_remediation=current.sys_id;


gr.update()


}


-Anurag

View solution in original post

14 REPLIES 14

Can you just give a description of the fields and their types used in the script



grc_risk   (i assume this is a table and there is a field also of the same name on grc_remediation)


u_risk_remediation...type?




-Anurag

grc_risk and grc_remediation are both tables we are currently working on.



u_risk_remediation(on grc_risk table) is a reference field that reference grc_remediation. The number field is the field that is automatically generated by the table. There is no u_risk_remediation field on grc_remediation.


current.grc_risk




what is the grc_risk here, its a field on grc_remediation ??




i want to know how are the 2 tables related


-Anurag

these tables were creating by a ServiceNow plugin ITGRC. This is the relationship that was created between the two tables by the plugin


current.addQuery('source_table', "grc_risk");


current.addQuery('source', parent.sys_id);



source is a document ID


Hi Ken



Use this, i hope this works



After


update/ insert


table - grc_remediation



condition


current.risk!=''



gs.addInfoMessage('started');


var gr=new GlideRecord('grc_risk')


gr.addQuery('sys_id', current.parent);


gr.query()


if(gr.next())


{


gs.addInfoMessage('Came here');


gr.u_risk_remediation=current.sys_id;


gr.update()


}


-Anurag