Variable formatter - Changes not saved

kristenankeny
Tera Guru

I extended the sc_req_item table, was able to add and update the formatter so that it displays the variables, but any changes made to variables are not saved. The save works on sc_req_item, but not on the extended table. Does anyone know what needs to be updated to allow edit of variables from an extension of sc_req_item?

1 ACCEPTED SOLUTION

kristenankeny
Tera Guru

After speaking with ServiceNow, we approached this solution differently. We kept the records on the sc_req_item table, instead of extending it. Then we added a field called "partitions" that has two values, one of which is default (so showing whatever view they have access to) and position_bundle, which triggers a view rule that forces them into the PositionBundle view. On the new record types, we set partition to "position_bundle" so that the view rules run.


View solution in original post

6 REPLIES 6

SanjivMeher
Kilo Patron
Kilo Patron

Hi Kristen,



You will need to create formatter it seems for the extended table. navigate to to System UI->Formatters.


find_real_file.png



Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,



I have the formatter already configured and it displays the current variables and their values. However, when I make a change to the value of a variable and save the record, that change is not captured.


Hi Kristen,



Please check if the below link helps.



Directly updating the question,answer table using below script. Not sure, if your vaules are getting stored in question_answer table.



(function executeRule(current, previous /*null when async*/) {



/*


This script is to fix the bug where SN would sometimes give variables on the record order -100 when created through


a Record Producer through the Service Portal.


*/



var qa = new GlideRecord('question_answer');


qa.addQuery('table_sys_id',current.getUniqueValue());


qa.query();


while(qa.next()){


  qa.order = qa.question.order;


  qa.update();


}


})(current, previous);




Re: troubleshoot variable editor



Please mark this response as correct or helpful if it assisted you with your question.

This seems to be the table for holding record producer replies, but I've extended sc_req_item. I've reviewed the business rules on sc_req_item and task and don't see anything about changes to variables other than some protections about inserting duplicates. I assume there is something controlling the save of variable value changes on sc_req_item, but I'm unable to find it. I'm trying to avoid customizing too much and just adapting the OOB scripts.