- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 10:39 AM
We have a record producer in our Human Resource: Core application. One of the variables is mapped to subject_person. I need to make this read only for non HR staff and non leaders. I thought this would be easy enough with a catalog client script however, I am getting a script error.
Script error: "[SCRIPT:EXEC] Error while running Client Script "Read only subject person": ReferenceError: sn_hr_core is not defined".
Syntax used: g_form.setReadOnly('subject_person', true);
Why would sn_hr_core not be defined?
Does anyone know how to work around this error?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 02:00 PM
You can't call a Script Include from a Client Script like this, you have to use GlideAjax. Here's an excellent guide on how to do that.
Also, add an alert on hrStaff - I'm not sure you can/need to use the application prefix when using hasRole.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 11:06 AM
Post your entire script using the insert code icon </>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 01:45 PM - edited 10-21-2024 01:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 02:00 PM
You can't call a Script Include from a Client Script like this, you have to use GlideAjax. Here's an excellent guide on how to do that.
Also, add an alert on hrStaff - I'm not sure you can/need to use the application prefix when using hasRole.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2024 02:03 PM
Ahhh... you are right. It's been a while. Thank you so much for the reminder!