- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 10:31 AM
Hi,
I have 2 methods within a script activity in the workflow for a catalog. I am trying to call <<current.fieldname>> and <<current.variables.variablename>> , but the value always comes as null.
If I print those values outside the method, I am able to print the values.
Can we not call Current within a method?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 01:43 AM
HI,
Try this :
gs.log("@@ first name "+current.variables.requested_for_first_name);
gs.log("@@ Short desc "+current.description); createRequest(current.description,current.company,current.variables.requested_for_first_name,current.variables.requested_for_last_name,current.variables.address1);
function createRequest(desc,comp,first,last,address) {
var restMessage = new sn_ws.RESTMessageV2('Order Request', 'Post');
restMessage.setAuthentication("basic", "Auth");
restMessage.setRequestHeader("Accept","application/json");
restMessage.setRequestHeader("Content-Type","application/json");
var addressBilling = {};
addressBilling.Description =desc;
addressBilling.CompanyName = comp;
addressBilling.Name_First = first;
addressBilling.Name_Last = last;
addressBilling.StreetAddress_Line1 = address;
gs.log("addressBilling "+addressBilling)
......
......
......
}
Thanks,
Ashutosh Munot

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 10:33 AM
What does your script look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 10:49 AM
gs.log("@@ first name "+current.variables.requested_for_first_name);
gs.log("@@ Short desc "+current.description); createRequest(current);
function createRequest(current) {
var restMessage = new sn_ws.RESTMessageV2('Order Request', 'Post');
restMessage.setAuthentication("basic", "Auth");
restMessage.setRequestHeader("Accept","application/json");
restMessage.setRequestHeader("Content-Type","application/json");
var addressBilling = {};
addressBilling.Description = current.description;
addressBilling.CompanyName = current.company;
addressBilling.Name_First = current.variables.requested_for_first_name;
addressBilling.Name_Last = current.variables.requested_for_last_name;
addressBilling.StreetAddress_Line1 = current.variables.address1;
gs.log("addressBilling "+addressBilling)
......
......
......
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 11:11 AM
HI,
Yes sometimes i have seen this situations.
But when i see you are passing the current glide record in function as well.
I think you might not be able to see variables right?
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 11:25 AM
Yes thats correct