Issue with pushing values to array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 01:56 AM
This line of code works in Background Script but fails in Script Include:
phonelist.push('+47' + employeeLookUp.mobile_phone.toString());
Any knows why and what is the alternative?
Script include is client callable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:49 AM
what is exact error.
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:57 AM
Hi @vidhya_mouli,
If possible, could you please share the error or screenshot for the reference.
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:59 AM
if you're calling the Script Include from the client-side and need to manipulate data from a GlideRecord, you could consider passing the required data to the Script Include as parameters, performing the necessary operations within the Script Include, and then returning the result back to the client-side code.
For example, you could have the client-side code pass the employeeLookUp object or just the mobile_phone value as a parameter to the Script Include. Then, within the Script Include, you can manipulate the data and return the desired result. Something like below
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
initialize: function() {},
// Method to process mobile phone number
processMobilePhone: function() {
var mobilePhone=this,getParameter('sysparm_mobile')//sysparm_mobile from client side
var phoneNumber = '+47' + mobilePhone;
return phoneNumber;
},
type: 'MyScriptInclude'
};
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks