Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

JSON Parse not working

Not applicable

HI Team,

 

We have written a script include which is Global scope and also Before BR also in same scope

We are calling the script include as below

 

var parseValue = JSON.parse(new CustomerAccountUtil().getRootParent(current.sys_id));

 

But on doing gs.addInfoMessage(parseValue );

 

Its giving undefined message/error. However at script include side when we do gs.log()  we are getting the proper output.

Kindly help

 

8 REPLIES 8

Not applicable

Hi @Community Alums 

 

 It will be helpful if you can share the code you have written in BR and Script Include.

 

Thanks!

Danish Bhairag2
Tera Sage

Hi @Community Alums ,

 

Can u try removing the JSON.parse and try calling the script include normally like below

 

var parseValue = new CustomerAccountUtil().getRootParent(current.sys_id);

 

Thanks,

Danish

 

Not applicable

I am getting message as Undefined  if we try calling the script include normally

Not applicable

var value=new CustomerAccountUtil().getRootParent(current.sys_id);

 

gs.addInfoMessage(value);

Above is giving Undefined message