JSON Parse not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:25 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:27 AM
Hi @Community Alums
It will be helpful if you can share the code you have written in BR and Script Include.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:42 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:44 AM
I am getting message as Undefined if we try calling the script include normally
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:46 AM
var value=new CustomerAccountUtil().getRootParent(current.sys_id);
gs.addInfoMessage(value);
Above is giving Undefined message
