Starfish Scripting Class
From within VBScript operations (ScriptedVariable, VBScriptProcedure, ScriptedField) in additional to normal VBScript functions, the developer has access to a custom “Starfish” class. The tables below define its usage. This class may also be used with C# scripting.
Class Properties
Property Name
|
Description
|
CurrentStageName
|
Read-only. Returns the name of the current stage. Useful during “Repeat Each Stage” Exec Operations to determine path of execution/next steps.
|
TotalRows
|
Returns the total number of Origin Rows in the job.
|
CurrentRow
|
Returns the current row number.
|
ReturnValue
|
Sets the return value to the calling application. Useful for passing an output back when the Job was called with an argument.
|
Origin ( String )
|
Returns the current Origin row’s value for the field specified.
|
PreviewMode | This boolean variable can be used to determine if you are Previewing or Running a Job. Returnes True of False. Ex: If PreviewMode <> True Then... |
Class Methods
Method Name
|
Description
|
GotoStage ( String )
|
Directs Starfish Engine to go directly to a Stage (skipping any others before it). String Parameter is the Name of the stage to go to. Once GotoStage has been called within a Job, it is considered in a “manual operation mode”. No more stages will be called in order and it will be up to the user to implement a After Each Stage Exec Operation to control stage flow. If no After Operation is called, it will go to the next row after the stage runs.
|
GotoNextRow ()
|
Skips all Stages and moves to the next Origin row.
|
EndJob ( String )
|
Cancels the Job execution immediately, ending with an error message as passed into the String param.
|
LogMessage ( String, MsgBoxStyle )
|
Appends a custom message to the Log which will always be displayed (even if Logging Level is set to None). Message is the passed in String parameter. Second parameter is a valid MsgBoxStyle (vbInformation, vbQuestion, vbExclamation, vbCritical)
|
GetFields ( String )
|
Executes a SQL SELECT statement returns all field values from the first row, comma-delimited. VBScript Split() function may be used to convert to an array within your function. Can improve performance when needing multiple fields from a single table.
|
ExecScalar ( String, String(Optional) )
|
Executes a SQL SELECT statement on the Destination database. Returns the first column of the first row returned by the query. Compatible with OLE DB destinations.
|
ExecScalarCache ( String )
|
Same as ExecScalar, except that results are cached and before a query is executed, a search is performed on a locally-stored set of results to prevent execution of identical queries, thus boosting performance. Should only be used for queries where multiple identical queries may be run (such as looking up user id’s or picklist values) – otherwise could consume resources needlessly.
|
ExecSQL
|
Executes a non-query statement, such as UPDATE or DELETE against the destination database. Returns number of rows affected. Compatible with OLE DB destinations.
|
SendEmail ( String, String, String )
|
Sends an email directly from within the VBScript function/procedure.
|
ParseName ( String, String )
|
Parses as string containing a person’s name, and returns the part of the name requested.
|
RemoveIllegalXMLCharacters ( String ) | This function removes Illegal XML Characters from a string.
This function can be used on a string before inserting it into the Target to resolve the "error in msg parsing: XML error parsing SOAP payload on line 32: Invalid character" error.
|
GetStageValue ( Integer, String)
|
Returns the destination value used on a previous stage.
|
SmartLookup ( String, String, String, [Boolean], [String], [String] )
|
Performs a lookup against the destination database, and returns one field value based on supplied filter.
|
SmartQuery ( String, [String], [String])
|
Performs a lookup query against the destination database, returns all columns and all rows from query as a multi-dimensional array.
|
XrefInitWrite ( String )
|
Initializes a cross-reference file for writing. If file exists, new data will be appended to it.
|
XrefInitRead ( String )
|
Initializes an existing cross-reference for reading. This reads all ids into memory so they will be available within your job.
|
XrefWrite ( String, String, String )
|
Writes a new ID reference entry to an initialized file.
|
XrefRead ( String, String )
|
Reads an ID entry from an initialized file. (Returns ID 2 from above)
|
BlackbirdMessage ( String, String, String, String, [String], [String] )
|
Send a Blackbird Alert message (server is specified in Web.config)
|
IsEmailValid ( String )
|
Returns True if supplied email address is in a valid email format; otherwise false.
|
FormatDate ( String, String )
|
Returns date in supplied format.
|
MoveFile ( String, String )
|
Moves a file on the server.
|
CopyFile ( String, String )
|
Copies a file on the server.
|
DeleteFile ( String )
|
Deletes a file on the server.
|
ReadFile ( String )
|
Reads a file in text mode and returns the contents as a string.
|
WriteFile ( String, String )
|
Writes the supplied contents to a file in text mode. Entire file is overwritten.
|
MS Dynamics CRM-Specific
| |
GetMCRMPicklistValue( String, String, String )
|
Returns the integer value for a supplied picklist string.
|
MCRMSetRelationship ( String, String, String, String, String )
|
Sets a relationship between two entites.
|
SugarCRM-Specific
| |
SugarSetRelationship (String, String, String, String )
|
Sets a relationship between two modules. Returns True or False based on the success of creating a relationship.
|
SugarSetRelationshipv4 (String, String, String, String, Number(Optional) )
|
Sets a relationship between two entities, compatible also with custom modules. Returns True or False based on the success of creating a relationship. Also able to remove a relationship between two entities with the optional fifth parameter. String – Module 1 Name
|
SugarGetRelationships ( String, String, String )
|
Gets comma-separated a list of ID’s related to an entity
|
SugarGetRelationshipsv4 ( String, String, String )
|
Gets comma-separated a list of ID’s related to an entity
Relationship Name |
Email (IMAP)-Specific
| |
MoveIMAPMessage ( String )
|
Moves the current email message to the specified folder on the server.
|