- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2016 08:58 AM
I have a records created through a catalog item, and want the variables following record creation to be readonly. I created a client script on table sc_req_item with simply alert('click') with no conditions. The client script only produces the alert when I click "New" for table sc_req_item, not when I load an existing sc_req_item with a variables pool populated. How do I get these to execute on existing records?
Onload client scripts against table sc_req_item:
function onLoad() {
alert('click'); //runs only on new item.
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2016 09:22 AM
William,
Look at your client script; you should see some checkboxes toward the top. Ensure that "Applies on Requested Items" is checked. This should solve your problem.
However,
I would use UI policies to do what you're attempting. Just create a UI policy with "Applies on Catalog Items" unchecked, and "Applies on Requested items" checked, and then create a UI Policy Action for each variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2016 09:14 AM
Try clearing cache and load the request item form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2016 09:44 AM
I tried this but unfortunately it did not work. I am able to access the parent object from within a catalog client script now through. thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2016 09:22 AM
William,
Look at your client script; you should see some checkboxes toward the top. Ensure that "Applies on Requested Items" is checked. This should solve your problem.
However,
I would use UI policies to do what you're attempting. Just create a UI policy with "Applies on Catalog Items" unchecked, and "Applies on Requested items" checked, and then create a UI Policy Action for each variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2016 09:37 AM
Thanks, I was able to get what I need done in a Catalog Client Script which had the checkmark you referred to. The original post however did mention to the sc_req_item table and the problem persists there so wondering if you have a solution for that as well. There is a no checkbox for standard client scripts.
Also, Applying a UI Policy action on each variable won't work because someone down the line will add a variable to the form and not know to set it visibility in a UI Policy. Makes app management a nightmare.