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 |
|
- JavaScript object: SCDatum
- JavaScript method: SCDatum.getSize()
- JavaScript method: SCDatum.getText()
- JavaScript method: SCDatum.getType()
- JavaScript method: SCDatum.getXML()
- JavaScript method: SCDatum.join()
- JavaScript method: SCDatum.JSDate()
- JavaScript method: SCDatum.length()
- JavaScript method: SCDatum.pop()
- JavaScript method: SCDatum.push()
- JavaScript method: SCDatum.setType()
- JavaScript method: SCDatum.setValue()
- JavaScript method: SCDatum.shift()
- JavaScript method: SCDatum.toArray()
- JavaScript method: SCDatum.unshift()
JavaScript method: SCDatum.length()
This method returns the number of array elements in an array stored in a Service Manager Datum object.
You can use this method to return the length of Service Manager array fields, which are always stored as Datum objects.
To query a particular array field in an SCFile object, use the following format:
SCFile_object.array_field_name.length()
.
Note Replace any periods in the name of array_field_name
with underscores. For example, you must convert the Service Manager array field update.action
to update_action
when querying it from JavaScript.
Syntax
SCDatum_object.length();
Arguments
There are no arguments for this method.
Return value
A number and RC_SUCCESS
or one of the other global return code values.
The method returns the number of array elements in an array stored in a Service Manager Datum object and a global return code value of RC_SUCCESS or returns one of the error global return code values if the method cannot return the number of array elements.
Example
This example does the following:
- Searches the probsummary table for any incident record you define in the search variable
- Attempts to get the size of the returned SCFile object (the result is always zero)
- Displays the contents of the action field (the action field contains Service Manager array data)
- Displays the size of the action field using the Service Manager length() method
- Converts the SCFile object into a JavaScript array using the Service Manager toArray() method
- Displays the size of the new JavaScript array using the core JavaScript length property
var incidentQuery; function findIncidents( query ) { print( "Searching for incident records starting with " + query + "..." ); var incidentFile = new SCFile( "probsummary" ); var findIncident = incidentFile.doSelect( "number#\""+ query + "\"" ); if ( findIncident == RC_SUCCESS ) { print( "Success. Found incident records starting with " + query + ". The first record is:\n" + incidentFile ); var objectSize = incidentFile.getSize(); print( "Running the getSize() method on the returned SCFile object produces the following result: " + objectSize ); var actionText = incidentFile.action; print( "The contents of the action field is:\n" + actionText ); var actionSize = incidentFile.action.getSize(); print( "The size of the action field is: " + actionSize ); print( "Converting the SCFile object to a JavaScript array..." ); var incidentArray = incidentFile.toArray(); print( "The new JavaScript array is:\n" + incidentArray ); var arraySize = incidentArray.length; print( "The size of the converted array is: " + arraySize ); return incidentFile; } else { print( "Could not find incident records starting with " + query + ". " + RCtoString( findIncident ) ); return null } } incidentQuery = "IM1005"; findIncidents( incidentQuery );