Script Include for styling fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 01:28 PM
Hello SN Community,
I want to create a script include that I can reuse multiple places to update the style on a field. I have this as client callable, but I don't believe I've written this correctly.
Here is the script include:
var VIPHighlighting = Class.create();
VIPHighlighting.prototype = {
getVIPStyle: function() {
callerLabel.setStyle({
backgroundImage: "url(images/icons/vip.gif)",
backgroundRepeat: "no-repeat",
backgroundPosition: bgPosition,
paddingLeft: '30px',
backgroundColor: "orange"
});
callerField.setStyle({
color: "red"
});
},
type: 'VIPHighlighting'
};
Thoughts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 07:03 PM
Hello,
It would appear from your script include that you must have checked the box for "Client callable" after you saved the record. Which means you're missing specific script that automatically gets populated there when you check that box, but you don't save (you can test and see what I mean by creating a new script include, and checking and unchecking the box before saving).
In any case, where are you trying to call this script include? In the style field, within the field style record, you are unable to access any javascript in that field and thus you can't call a script include.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 07:47 AM
Hi Allen,
I do have the Client Callable field checked TRUE and I also have this set to All Application Scopes.
That said, I would be calling this from multiple client scripts.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 07:50 AM
Hello,
Please re-read my reply above as I didn't say you don't have the client callable checkbox true, I said you must have checked the box after...you saved, because there is critical script missing from your script include that gets set when you check that box before you save the record. As mentioned above as well, feel free to create a new script include, check the box, uncheck the box, and don't save anything...and you'll see what I'm talking about.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!