
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 08:54 AM
Hello SNow community,
i have often used "javascript:gs.getUserDisplayName()" in catalog items variables "Default value" field to dynamically set logged in user.
I now also want to call a function stored in catalog item script (type onLoad) to dynamically load values.
Variable:
Eg "javascript:mycustomclientscriptfunction()" -> "Default value"
Catalog Item script (onLoad):
function mycustomclientscriptfunction(){
return 'test';
}
Unfortunately this did not work. How to achieve this? Any hints ideas? Maybe there is a better way to go with "overall" ScriptIncludes? Do you have some samples for this?
Thx a lot and best regards
Vesp
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 09:10 AM
You can't call a client script or any client side code from the default value. You should be able to call an OOB or your own script include from the default value field, though.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 10:06 PM
Hallo Brad, thanks for clarification. Do you have a sample for calling a script include from default value? I have not seen this so far. As i "simply" want to preload some data, i want to avoid bigger catalog item script (client side).
Thx & br,
Vesp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 10:15 PM
Hey,
"javascript: new ScriptIncludeName().FunctionName()"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 02:10 AM
Thanks for all the fast replies. With samples from Brads link i could manage to directly use needed Javascript in Default Value field (without calling catalog item script or script include).