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 |
|
Links
This example shows how to query a record from within Service Manager, and how to update fields in that record. Additionally, it shows how to transfer an array from Service Manager to JavaScript. An array from Service Manager cannot be directly copied into a JavaScript array, because the syntax of Service Manager {“IM1001”, “IM1002”} does not work in JavaScript. Properties such as the length property assume that the value is a function if it is enclosed in curly braces {}. To successfully convert a Service Manager array into a JavaScript array, you can either use the SCFile.toArray method, or create a while loop or a for loop to move through the elements and do an element-by-element transfer, as shown above.
Note In JavaScript, it is very important that you handle null values. Functions such as length may not work on null values.
In this example, the JavaScript code performs the following functions:
- Queries the configuration item that was previously selected from a fill.
- Increases a counter in that configuration item called num.issues.on.CI (this new field has to be added in the device file).
- Adds the new record number to an array of issues in the device file called array.incidents.
- Updates the device record.
- Issues an error message if the configuration item does not exist.
- Sends an alert to the person who is opening the record if the item is currently down.
var CI_Record=new SCFile("device"); /* opens the device file */ var CIName=system.vars.$File.logical_name; /* passes in the logical name from $File */ /* Selects the configuration item to update */ function getConfigurationItem( CIName ) { var findCI_RC = CI_Record.doSelect( "logical.name=\""+ CIName + "\"" ); if (findCI_RC==RC_SUCCESS) { return CI_Record; } else { print( "Could not find configuration Item. " + RCtoString( findCI_RC ) ); return null; } } /* Increases the use counter that counts how often this item was affected by an incident ticket and enters the incident ticket number into the array of incidents */ function increaseUseCounter(CI) { if (CI.is_down == true) { print("The configuration item is down at the moment. Please check existing tickets if the cause for this issue is related to the down system."); } CI.num_issues_on_CI++; /* increase counter */ var incNumber = system.vars.$File.number; /* get the incident ticket number */ var array_incidents = new Array(); var ind = 0; while(CI.array_incidents[ind] != null) /* convert the SC array into a JS array (see paragraph below) */ { array_incidents[ind]=CI.array_incidents[ind]; ind++; } var j=0; var temp_string = array_incidents.toString(); var i = temp_string.indexOf(incNumber); if (i < 0) /* Check if incident is already in the list */ { /* If not, enter the incident number to the list */ if (array_incidents == null) { j=0; } else { j=array_incidents.length; } array_incidents[j] = incNumber; CI.array_incidents = array_incidents; } CI.doUpdate(); } /* Call previously defined functions to execute code */ CI=getConfigurationItem(CIName); increaseUseCounter(CI);