GoldMine Enterprise Edition Tips & Tricks



Actipro license error

Getting the Actipro license error?

Solution:

1. Close ITSM Administrator
2. Extract attached zip-file
3. Open/Run the registry file 'Actipro-syntaxeditor.reg' (Actipro-SyntaxEditor.zip).

Download the zip here

 

Executing SQL through JScript

This MUST be created as a named expression

import System
import Fusion
import Fusion.Api

class FusionScriptWrapper implements IScriptWrapper
{
     function FusionScriptWrapper()
     {
          // place constructor logic here
     }

     function Process(currentBusinessObject : Fusion.Api.BusinessObject, currentField : Fusion.Api.Field) : Object
     {
          var objReturn : Object

          // place code to be run here

 var oConn = new ActiveXObject("ADODB.Connection");
 oConn.Open("Provider=SQLOLEDB;Data Source=MUMBLES;User ID=gmee;Password=gmee;");
 oConn.ConnectionTimeout = 3000;
 var oRs = oConn.Execute("Use GMEE; UPDATE ACCOUNT SET ACCOUNTNAME='XXXX'");
 oConn.Close();

          return objReturn
     }
}

 

Simple Alerts through JScript

This is a simple way to insert an "alert" or "message" into your Jscript. I use this all the time for debugging or simply reminding users of next steps:


var alert=new ActiveXObject("wscript.shell")
alert.Popup ("Please press the big red button.")

 

I've been asked how to make this display with multiple lines:

var alert=new ActiveXObject("wscript.shell")
alert.Popup ("Line 1"+char(13)+"Line 2"+char(13)+"Line 3")


JScript writing to file

Simple demonstration of writing to a file. Again I've done this as part of wider JScript so using a quick action didn't work for me.


// Instantiate a File System ActiveX Object:
var fso = new ActiveXObject("Scripting.FileSystemObject");
// Invoke the method:
var a = fso.CreateTextFile("c:\\testfile.txt", true);
// Do something with it:
a
.WriteLine("You can use this to write an XML file, CSV or whatever is required");
// Close the connection:
a
.Close();
 
contact information