Script type field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2015 05:42 AM
Hi All
In Snow, if I make a custom table , and in that table if i make a "script" tyep field ,
the value of script field is like this
answer=Somefunction();
When is the script executed and what is the scope of variable "answer" ie where all can I Use it?
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2015 05:53 AM
When the field is called, the script is run.
For example, let's say you have a script field (called 'script_field') that has the script return an integer. You can then write a business rule saying when script_field > 3. It is then run when that business rule is run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2015 01:33 AM
Hi Mike
As u said , I tried to find some reference to "u_script" or the variable "answer" but couldn't find any , apart from
SomeFunction() defined in a script include. Any Idea what I am missing? and does it mean the script is not executed at all?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2015 04:17 AM
It's not just answer. You can return whatever you want it to return.
https://community.servicenow.com/thread/173066