How to save a record from client side script

Som8
Tera Contributor

Dear Folks,

Is there any way to save a field value from client side script.I was using the below script :  

g_form.setValue("u_risk_assessment_check",'false');

  g_form.save();

but is not saving the value. The value is getting set but it vanishes while the form is reloaded.

function invokeAssessment() {

  g_form.hideAllFieldMsgs();

  g_form.setValue("u_risk_assessment_check",'false');

  g_form.save();

  var id = g_form.getUniqueValue();

  //For risk assessment question "Has a recent incident been raised against the Assignment or Affected CI's?"

  var v_ga = new GlideAjax("jnjChgRiskAssessment");

  v_ga.addParam("sysparm_name", "riskQuestions");

  v_ga.addParam("sysparm_id1", id);

  v_ga.addParam("sysparm_class1", "change_request");

  v_ga.getXMLAnswer(function (res1){

  res2=res1;

  });

7 REPLIES 7

Hi All,



I tried using g_form.save(); and its saving value on the form. But the form is continuously loading.


Is there anything which i am missing?


Please suggest.



Thanks,


Bhushan


Did you figure out the solution for this. If so, please let me know. Even I have the same issue.



Thanks in advance


could you please share script here??



Please mark my response as correct and helpful if it helped solved your question.
-Thanks