Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Calling a function in the ScriptLibrary
ScriptLibrary records contain functions that can be called from anywhere you can call JavaScript. Using this technique allows for more effective management of user JavaScript functions. Functions can use parameters as part of the calling structure, and they can also return values.
First, you must establish a record in the ScriptLibrary that contains the function to be called. Within the record you must know the name of the script as well as create a properly-constructed function.
Note A record can contain more than one function.
This is an example of using more than one function.
/* Sample script system.library.functionTest */ function square(value) { var ret_val = value * value; return ret_val; } function cube(value) { var ret_val = value * value * value; return ret_val; }
To call the function use the following syntax:
system.library.<script name>.<function name>(<Comma separated list of parameters>)
The following is an example of calling the functions of system.library.functionTest:
var x = 3; var y = system.library.functionTest.square(x); print(x, " squared = ", y); x = -2; y = system.library.functionTest.square(x); print(x, " squared = ", y); x = 2; y = system.library.functionTest.cube(x); print(x, " cubed = ", y); /* The function calls produce the following output: 3 squared = 9 -2 squared = 4 2 cubed = 8 */
When working with the ScriptLibrary, you can compile the JavaScript code to check for syntax errors. Executing the script will compile the code and then run it. Before executing the code, ensure that all inputs are available.
You can access any script or function in the ScriptLibrary from any tool within HPE Service Manager that supports JavaScript, by using the following syntax:
system.library.<scriptname>.<functionname>( parameters )
Within a ScriptLibrary record, you can call any function that is defined previously within the same record by simply typing:
<functionname>( parameters )
To call JavaScript from any RAD process panel, you can use the jscall RAD function. The syntax for this function is:
jscall( "script.function" , arg1 , arg2, ... , argN )
The following statements illustrate a JavaScript call to the system library and a call to the script library by using jscall(), respectively:
system.library.tzfunctions.getTZforOperator(“falcon”); jscall("tzfunctions.getTZforOperator", “falcon”);
To call a JavaScript function from the operating system's command prompt, you can use the us.js.call RAD routine. The syntax for the command is:
sm us.js.call script.function arg1 arg2
As an example, the following command calls the UpdateAllInteractions.updateInteractionFields function, which needs the {"abc", "def"}
arguments:
sm us.js.call UpdateAllInteractions.updateInteractionFields {\\\"abc\\\",\\\"def\\\"} NULL
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-ITSM@hp.com.
Help Topic ID:
Product:
Topic Title:
Feedback: