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 |
|
- List: JavaScript global methods
- JavaScript global method: base64Decode
- JavaScript global method: base64Encode
- JavaScript global method: compile
- JavaScript global method: doHTTPRequest
- JavaScript global method: doSOAPRequest
- JavaScript global method: execute
- JavaScript global method: getLog
- JavaScript global method: help
- JavaScript global method: insertDatum
- JavaScript global method: makeSCWebURL
- JavaScript global method: print
- JavaScript global method: Quit
- JavaScript global method: RCtoString
- JavaScript global method: readFile
- JavaScript global method: setAppMessage
- JavaScript global method: stripHtml
- JavaScript global method: uncompressFile
- JavaScript global method: writeAttachmentToFile
- JavaScript global method: writeFile
- JavaScript global method: xmlstring
JavaScript global method: writeAttachmentToFile
Writes a requested attachment record to the local file system.
Syntax
writeAttachmentToFile( File, Application, Topic, UID );
Arguments
The following arguments are valid for this method:
Name | Data type | Required | Description |
---|---|---|---|
File
|
String | Yes |
This argument specifies the file name of the attachment you want to write out to the file system. You may also use this argument to specify the destination path of the attachment. If this argument does not specify a path, Service Manager creates the attachment in the system working directory. |
Application
|
String | Yes | This argument specifies the application name portion of the key that Service Manager uses to identify the attachment in the SYSATTACHMENTS table. |
Topic
|
String | Yes | This argument specifies the topic name portion of the key that Service Manager uses to identify the attachment in the SYSATTACHMENTS table. |
UID
|
String | Yes | This argument specifies the unique identifier portion of the key that Service Manager uses to uniquely identify the attachment in the SYSATTACHMENTS table. |
Return values
RC_SUCCESS or one of the other global return code values.
The method writes the attachment record specified in the method arguments to the local file system and returns a global return code value of RC_SUCCESS or returns one of the failure global return code values if the method cannot return an attachment record.
Description
This method extracts the specified attachment from the SYSATTACHMENTS table and writes it to the specified file and path on the local file system.
Note If you specify a path, you must escape out any JavaScript reserved-characters in the path name such as slashes and backslashes. Consult a JavaScript reference for a full list of JavaScript reserved-characters and escape methods.
Example
This example does the following:
- Requests an attachment from the SYSATTACHMENTS table
- Writes the attachment to the file c:\kmdocument.pdf
- Prints the return code to the screen
This example requires the following sample data:
- The Knowledge Management record KM0018
- An attachment in KM0018
var rc; rc = writeAttachmentToFile( "c:\\kmdocument.pdf", "kmdocument", "KM0018", "4462590a062ee0c2101d85c8" ); if ( rc == RC_SUCCESS ) { print( "kmdocument.pdf successfully created" ); } else { print( "kmdocument.pdf failed " , RCtoString(rc) ); }