Using Starfish Scripting Class Properties & Methods in C

From Starfish ETL
Jump to: navigation, search

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 in this wiki.

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)
			Starfish.LogMessage("Count: "+ runCnt.ToString());
		} else {
			runCnt = 0;

		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;