
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 09:43 PM
Hi All
We have a client script that we use in a couple of catalog items, that takes the expiry date for the selected user (based on another reference field to select a user) and shows it in a read only field.
I've noticed during testing (we are pre go-live) that it works fine for ITIL users and admins, but not for standard users.
By default the user field populates to whoever is logged in. In this case it will work.
e.g. i am logged on as a standard user who has an account expiration, i can see my expiration date in the field. If i change the selected user to another user who also has an expiry, the field will not populate with their expiry - it becomes blank. If i set it back to myself, it will return the correct expiry again.
If i am logged on as an ITIL user or Admin, it works no matter who you select.
I suspect some kind of security issue on the sys_user table is preventing standard users from seeing the values for others. I am wondering, if this is the case - and if so is there an easy way to give standard users RO permissions to this field?
The client script is as follows .
function onChange(control, oldValue, newValue, isLoading) {
if ( newValue == '') {
return;
}
var GateExpiry = g_form.getReference('u_Contractor', getDate);
function getDate(GateExpiry)
{
g_form.setValue('u_account_current_expiry', GateExpiry.u_expiry_end_date);
}
g_form.setReadOnly('u_account_current_expiry', true);
//g_form.setMandatory('u_account_current_expiry', true);
}
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 04:57 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 09:48 PM
Hello,
Avoid using getReference() as it is synchronous server call. It can impact the performance.
instead use glideAjax for asynchronous() server call.
Please find below docs for more details.
https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/server_scripting/reference/r_ExamplesOfAsynchronousGlideAjax.html
Let me know for any query.
Cheers!!!
Ali
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 04:57 PM
Hi All
We managed to resolve this, it was an ACL issue. thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 05:47 AM
Hi Kai
I have this exact same issue, can you remember which ACL it was that caused you the problem?
Thanks
Anita