- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 09:54 AM
Hi
i am trying to hide an option of a record producer based on the user's email id.
If the user has domain usa then the user should see the option of a variable.
Anyone else apart form usa should not see this option.
i have used Script Include and Catalog Client script.
Despite this i am still able to see the option lease.
The variable Expenditure type is a Look up select box and the Expenditure comes from sys_choice table i have added the option there
Script Include: Client Callable is on
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 10:29 AM
Hi @Abdul ,
here is the updated version of scripts
script include (make sure the client callable checkbox is checked)
var CheckUserEmailDomain = Class.create();
CheckUserEmailDomain.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isParklandUser: function() {
return gs.getUser().getEmail().toLowerCase().includes('@parklandusa.com');
},
type: 'CheckUserEmailDomain'
});
client script
function onLoad() {
var ga = new GlideAjax('CheckUserEmailDomain');
ga.addParam('sysparm_name', 'isParklandUser');
ga.getXMLAnswer(function(response) {
if (response == 'false' || response == false) {
// g_form.addOption('u_expenditure_type', 'lease', 'Lease');
g_form.removeOption('u_expenditure_type', 'lease');
}
});
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 10:29 AM
Hi @Abdul ,
here is the updated version of scripts
script include (make sure the client callable checkbox is checked)
var CheckUserEmailDomain = Class.create();
CheckUserEmailDomain.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isParklandUser: function() {
return gs.getUser().getEmail().toLowerCase().includes('@parklandusa.com');
},
type: 'CheckUserEmailDomain'
});
client script
function onLoad() {
var ga = new GlideAjax('CheckUserEmailDomain');
ga.addParam('sysparm_name', 'isParklandUser');
ga.getXMLAnswer(function(response) {
if (response == 'false' || response == false) {
// g_form.addOption('u_expenditure_type', 'lease', 'Lease');
g_form.removeOption('u_expenditure_type', 'lease');
}
});
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya