Want to populate legal entity based upon GL company code and legal entity from two different tables.

Tarasingh26
Tera Expert

Hi All,

 

I want to populate legal entity (node 2 ) based upon field GL company code on one table and legal entity from another table. These two fields have same values. I am trying to achieve it by below script but it says Legal Entity Undefined. If anyone worked on similar kind of script then please give solutions. Thanks in advance.

 

var le;
var costCentre = new GlideRecord("cmn_cost_center");
costCentre.query();
while(costCentre.next())
{
var legalEntity= new GlideRecord("sn_risk_advanced_Legal_entities");
legalEntity.addQuery('u_entity_code', costCentre.u_gl_company_code);
legalEntity.query();
le=legalEntity.u_node2;
}
g_scratchpad.lgl_Enty=le;

1 REPLY 1

AryanA
Tera Contributor

To Understand What is a GL code and how to automate it? Read This Blog..