Record Producer variables data cleared after form is saved

Sivakrishna
Kilo Sage

When I have filled data in the record producer variables in at portal after submitting the variable value, it is creating HR case and automatically the HR case state showing closed and incomplete and also variables value is showing blank. I have enclosing the Snips.

 

Please suggest me solution on urgent basis.

 

The record producer is below:

current.hr_service = "7aa5459cdbb46818f2ebf572f396195f"; //China Personal Data Changes
current.opened_for = producer.employee_name;
current.subject_person = producer.employee_name;
current.short_description = gs.getMessage("China Personal Data Changes");
current.contact_type = "self-service";
current.u_record_producer = "4fd0be97db246414f2ebf572f3961930";
 
current.enter_effective_date_of_legal_name_change =
producer.enter_effective_date_of_legal_name_change.getDisplayValue();
 
current.enter_new_legal_name = producer.enter_new_legal_name.getDisplayValue();
 
 
 
var desc = "";
/if (producer.national_id == 'true') {
    desc += "\n" + gs.getMessage("National ID") + ": ";
    desc += "\n " + gs.getMessage("Effective Date of National ID Change") + ": " + producer.effective_date_of_national_id_change.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter New National ID") + ": " + producer.enter_new_national_id.getDisplayValue();
}
if (producer.passport == 'true') {
    desc += "\n" + gs.getMessage("Passport") + ": ";
    desc += "\n " + gs.getMessage("Effective Date of Passport Change") + ": " + producer.effective_date_of_passport_change.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter New Passport") + ": " + producer.enter_new_passport_number.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter passport expiry date") + ": " + producer.enter_passport_expiry_date.getDisplayValue();
}
if (producer.legal_name == 'true') {
    desc += "\n" + gs.getMessage("Legal Name China") + ": ";
    desc += "\n " + gs.getMessage("Effective Date of Legal Name Change") + ": " + producer.enter_effective_date_of_legal_name_change.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter New Legal Name") + ": " + producer.enter_new_legal_name.getDisplayValue();
}
if (producer.bank_information == 'true') {
    desc += "\n" + gs.getMessage("Bank Information") + ": ";
    desc += "\n " + gs.getMessage("Effective Date of Bank Information Change") + ": " + producer.enter_effective_date_for_bank_information_change.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter New bank account number") + ": " + producer.enter_new_bank_account_number.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter Bank account name") + ": " + producer.enter_bank_account_name.getDisplayValue();
    desc += "\n " + gs.getMessage("Enter Bank account branch") + ": " + producer.enter_bank_account_branch.getDisplayValue();
}
current.description = desc;

 

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@Sivakrishna 

any client script is running and clearing the variable value?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @ Ankur

There is no Client Script on this record producer.

 

Thanks

 

Sivakrishna

benn23
ServiceNow Employee
ServiceNow Employee

Anything in the system log?  Maybe a bad script.  What's that forward slash before the if?

var desc = "";
/if (producer.national_id == 'true') {

@benn23 

No system log is available. 

 

You can ignore that forward slash before if, while copy pasting, it is pasted mistakenly.

 

You can suggest me the solution on urgent basis.

 

Thanks

 

Sivakrishna