Service Desk Practitioners Forum
cancel

setSystem to HistoryLine

Highlighted
VKornienko
Contributor.

setSystem to HistoryLine

When I try to create new history line programatically, i can change Subject field and others. But when I try to change System field RuntimeException throws with following message: Program error: the attribute 'system.' of this history line service call cannot be modified, because the history line service call item was opened in view mode or because the attribute is read-only.
I use administrator's login.
My question is: how can I create new History line with system filed set to TRUE?

I use following source code for creating new HistoryLine:

session = ApiSDSession.openSession (server, login, password);
IHistoryLineServicecallHome hlsch = session.getHistoryLineServicecallHome();
IHistoryLineServicecall hlsc = hlsch.openNewHistoryLineServicecall();
hlsc.setSubject(hLine);
hlsc.setSystem(Boolean.TRUE); // exception throws here
servicecall.addHistoryLine(hlsc);

Thank you for your kind attention.
5 REPLIES
atl_ala
Regular Contributor.

Re: setSystem to HistoryLine

that one will be set by the system automatically I guess. I am working on how can add an additional field to histry line field either.
VKornienko
Contributor.

Re: setSystem to HistoryLine

How can I make system to set this flag to new history line that I create? I need it.
Ruth Porter
Acclaimed Contributor.

Re: setSystem to HistoryLine

Hi there,

You could try a simple approach where you update a custom field and make that audited; then the system flag will beset.

Hope this helps

Ruth
http://www.teamultra.net
VKornienko
Contributor.

Re: setSystem to HistoryLine

Can you provide me with some example... I can't understand what does phrase "make that audited" mean :(
Ruth Porter
Acclaimed Contributor.

Re: setSystem to HistoryLine

Hi there,

Set up a custom field (Data>Custom fields) and then go to in
Security (v4.5) or Users & Security (v5)> Audit >Audit rules>item type and select the field you just created.

Then your code can update this custom field and the details will be in the history as a system line because it has been audited.

Hope this helps

Ruth
http://www.teamultra.net