RE: getVariable("messageId")
Hi Simen,
Thanks for your elaboration.
For the values I used the print function in stead of the log function, since I an in Online. This gives me the following result when started from a message.
Var: AIMRevision: 8.1.0000.0Var: AIMVersion: 8.1.0000.0Var: __returnScreen: 5Var: _sf: 0Var: action: doScriptVar: activeAssociateId: 5Var: activeUser: 2Var: activeUsername: NBVar: contactId: Var: debugId: Var: entryId: 497Var: id: 55Var: messageId: Var: personId: Var: serverName: online.superoffice.comVar: ticketId: Var: userLang: nl
So I seems that the messageId is actually not filled, but fortunately the entryId is and contains the value of the messageId.
So I changed my script to the following and this works! I had to add the last part, since returning to the screen did not work either since the TicketID was not put in the variables.
Thank you for the tips!
#setLanguageLevel 3;
Integer messageId = getVariable("entryId").toInteger();
Message m;
m.load (messageId);
m.setValue("slevel","2");
m.save();
String ticketId=m.getValue("ticketId");
setVariable("url", getProgram(1) + "?action=listTicketMessages&ticketId=" + ticketId);