Using Starfish Scripting Class Properties & Methods in C#

Using Starfish Scripting Class Properties & Methods in C#

See available Starfish Scripting Class Variables, Properties and Methods. To use these variables, properties and methods, you must append "Starfish." to the beginning of variable, property or method AND you must use the exact capitalization as found here and in the scripting class. 
Example using the PreviewMode Property and GetSetting and SaveSetting Methods:

	if (!Starfish.PreviewMode)
	{
		//Set the last run datetime for this user.
		Starfish.SaveSetting("Meetings-LRD-"+gUserID, DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss+00:00"));
		
		//Check to see if there are more users to process and if so, restart job.
		string uIDs = Starfish.GetSetting("UserIDs");
		//This Setting is set in the first Job and will restrict runs to only the Admin user.
		bool b = Starfish.GetSetting("AdminUserOnlyTesting_True_OR_False") == "True";
		if (b) {
			uIDs = "ADMIN";
		}
		if (runCnt < uIDs.Split(';').Length-1)
		{
			runCnt++;
			Starfish.GotoJob("e8566f56-69cd-4d65-8835-351de24795e3");
			Starfish.LogMessage("Count: "+ runCnt.ToString());
		} else {
			runCnt = 0;
			Starfish.GotoNextRow();
		}

		string quoteID = Starfish.XRefRead("SLXQuoteIDs",Starfish.OriginData["OPPORTUNITYID"].ToString());
		if (String.IsNullOrEmpty(quoteID))
		{
			quoteID = Starfish.SmartLookup("Quotes","id","[{\"foreignid_c\":\""+Starfish.OriginData["OPPORTUNITYID"].ToString()+"\"}]").ToString();
		}
		return quoteID;
	}

    • Related Articles

    • Starfish Scripting Class Object

      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 ...
    • Examples of using Starfish Class Functions In Javascript

      This code was used to lookup a value inside of SugarCRM using the Sugar REST connector. function scriptedField() { var res = ""; res = vals["Branch Name"]; if (res) { Starfish.LogMessage(res.toString()); } res = ...
    • Starfish Monitor

      Installation Beginning with Starfish ETL 3.8, the Starfish Monitor service is included and created when you install the Starfish Scheduler. The Monitor service's Startup Type is set to 'Manual' by default. If you wish to use this service, you should ...
    • Starfish Ray

      Overview The Starfish Ray is a light-weight footprint service installed on a client machine which enables the movement of data from a system behind the firewall to other cloud-based systems. Our cloud hosted Starfish software facilitates this ...
    • Starfish Scheduler

      Installation The Scheduler is a run as Windows Service. It may installed on any server which has access to the web service, but for the sake of simplicity it is recommended to be installed the same server as the Starfish Engine. The Scheduler reads ...