Service Portal Form changes not been saved to Database

ChristopherF
Tera Contributor

Good morning all,

 

My requirement is to capture field changes in an existing SMP record in the Service Portal for a Custom table.

 

I created a couple of fields in the "u_security_toolkit" table using a Catalog client script. When I update the field values in the Service Portal, the value gets updated by the script does not get saved to the database (SMP form) but it shows on the Service Portal form- (generated RITM)

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('SMPUtils');
ga.addParam('sysparm_name', 'EditRegGetDetails');
ga.addParam('sysparm_id', newValue);
ga.getXML(getSMP);
}

function getSMP(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
//answer = answer.evalJSON();
answer = JSON.parse(answer);
g_form.setValue('assurance_type', answer.assurance_type);
g_form.setValue('bid_manager', answer.bid_manager);
g_form.setValue('business_line', answer.business_line);
}

 

Any help will mostly appreciated.

 

Thanks for asistance in advance.

 

Regards

Chris

 

 

 

 

1 REPLY 1

ChristopherF
Tera Contributor

HI all,

I have resolved above issues using Update Record Action and mapping associated form and variables fields in Flow designer as seen below referencing the SMP number field in the variable. 

 

ChristopherF_1-1729609058445.png