Wednesday, January 06, 2010

A new decade and some new directions




2010 looks like it will be a big year for me... For the past decade I've been working with the Frontrange product set and this year I've taken the plunge and dropped it all for ServiceNow.

It was a pretty big decision to make and essentially means I'm moving from a Big Fish in the pond to a Small Fish. It will be an interesting time for me because I haven't been in this position for at least 10 years.

For the most part I'm looking forward to it. There is the obvious apprehension as I'm leaving a job I've basically been working in for 10 years.

I haven't had to learn something completely new for a long time so I'm really looking forward to getting stuck into some new technology.

It should be a fun year full of change.... at least that's the plan

Thursday, December 03, 2009

FUDs in ITSM 6.1.5/6.1.6

As some of you are probably aware, the FUD process is giving unexpected results for the ITSM 6.1.5 and 6.1.6. Whilst you’re able to create an upgrade set, importing the FUD on the target database results in an object reference error.


It seems that it will only error if my FUD included any field definitions. Anything else (quick actions, expressions, BR’s, triggers, panel defs) would still succeed in being imported.




There is a bit of a work around for this issue but it's not the prettiest solution and is not very customer friendly. I'm going to assume the version is 6.1.6 but it works equally well for 6.1.5


1. Create a FUD in your source system in 6.1.6
2. Open Administrator on a 2nd test version of target database in 6.1.1
3. Import the FUD (from the 6.1.6 system) into the Administrator in 6.1.1
4. Take the Definition set created by the FUD Process Import in the 6.1.1 Administrator and save in another location (provided the commit was successful)
5. Open Administrator on your normal Development Environment in 6.1.6.
6. Open the definition set saved in step 4 in the 6.1.6 Administrator
7. Commit.


This seems to solve the issue but as I said it's not pretty, fast or customer friendly

Monday, September 21, 2009

Prompting for a Confirmation Yes No Message box when completing an assignment

The combination of script expression and button guard allows you to pop a yes/no box to confirm that an assignment is to be completed

First Create a script expression with the code below *obviously you can edit the text of the message box you want to appear.
import System
import Fusion
import Fusion.Api
import System.Reflection

class FusionScriptWrapper implements IScriptWrapper
{
function FusionScriptWrapper()
{
// place constructor logic here
}
function MessageBox(text:System.String, caption:System.String, MessageBoxButtons:System.String, MessageBoxIcon:System.String)
{
try
{
var assembly : System.Reflection.Assembly;
var MessageBox : System.Type;
var Buttons, Icon, result : System.Object

assembly = Assembly.LoadWithPartialName("System.Windows.Forms");
MessageBox = assembly.GetType("System.Windows.Forms.MessageBox");
Buttons = System.Enum.Parse(assembly.GetType("System.Windows.Forms.MessageBoxButtons"), MessageBoxButtons);
Icon = System.Enum.Parse(assembly.GetType("System.Windows.Forms.MessageBoxIcon"), MessageBoxIcon);

var argMSG : System.Object[] = [text,caption,Buttons,Icon];

result = MessageBox.InvokeMember("Show",System.Reflection.BindingFlags.InvokeMethod,null,null,argMSG);

return result.ToString();
}
catch(exc : System.Exception)
{
return null;
}
}
function Process(currentBusinessObject : Fusion.Api.BusinessObject, currentField : Fusion.Api.Field) : Object
{
var objReturn : Object

var userResponse : System.String;
userResponse = MessageBox("Are you sure you want to complete this assignment?","Assignment Completion","YesNo","Question")

if (userResponse=="Yes")
{
objReturn = true
}
else
{
objReturn = false
}


return objReturn
}
}

Then select the properties of the complete button. Select the "Action" tab and select the Guard Tab with in it (shown below)



Add the new expression ( which I called MsgBoxTestPrompt) as the condition. Select the Nothing option in the behaviour drop down.

Now when the user selects the complete button they are prompted if they are sure the want to complete. If they select Yes then the action will fire. If the select No nothing will happen.

The only thing to be careful of is that guards don't prompt in the web (or any prompt for that matter)

Wednesday, September 09, 2009

A helpful tip for troubleshooting IIS

The extended logs for IIS (stored in ..\Windows\System32\Logfiles\W3SVC1\) are stored in GMT time by default which can make finding your issue a little bit harder. Here's a simple way to change it to your local time.

The W3C Extended Logging format spec requires logging in GMT time. You can set the log roll-over to occur at midnight local time if you want. This avoids problems with situations like Daylight Savings, where you log goes "backwards in time" by an hour.

To enable logfile rollover based on local time, not GMT, open the IIS Manager, locate your website, rightclick and choose "Properties". On the "Web Site" tab, click "Properties" next to logging. Then check "Use local time for filename and rollover"

Saturday, September 05, 2009

Updating fields with a Script Expressions

I've found this line of code invaluable when Quick Actions and Business Rules just won't work for you
currentBusinessObject.GetField("FieldName").SetValue(new Fusion.FusionValue(VariableName));
It writes the variable VariableName to the field FieldName in the current business object. You can also replace VariableName variable with a value of any type (obviously in the format "String")