The CreatorCon Call for Content is officially open! Get started here.

problem workaround field

johnrob18
Giga Guru

I have taken Problem OOB. When I type in the workaround field on the problem record does not seem to hold the data , once I have saved the record, the contents disappears - there ia an entry on the audit trail but cannot see any thing in the field.

How does the 'cascade worksround' function work - again this does not seem to do anything?

1 ACCEPTED SOLUTION

It's slightly different based on the field type.   This code has both ways.   You can just un-comment whichever one you want to use.



current.update();


workaround();



function workaround(){


      var num = current.number;


      var incident = new GlideRecord("incident");


      incident.addQuery("problem_id", "=", current.sys_id);


      incident.addQuery("incident_state", "<", 6);


      incident.query();


      while (incident.next()) {


              //incident.comments = (num + ' ' + current.work_around.getJournalEntry(1)); //Communicate last entry from journal field


              incident.comments = (num + ' ' + current.work_around); //Communicate from standard string field


              incident.update();


      }


      gs.addInfoMessage('Workaround communicated');


      action.setRedirectURL(current);


}


View solution in original post

5 REPLIES 5

Hi MArk - I have sorted this thanks for your help - I was not putting the u_ in front of the user defined fields