fields are not mapped on backend table when request is submitted using record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have created record producers , I am having supplier name reference fields and on selection of supplier name field 4 fields gets autopopulated on the form but it is not getting saved to backend table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Where are you setting those four fields? Are you setting them in your script of the record producer? If so, we may need to see that code to see if there might be an issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
in Client Script
Make sure you're using g_form.setValue() (not just setting display values) in your onChange client script:
Record Producer Client Script (onChange):
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } // Get supplier details var supplierID = newValue; var ga = new GlideAjax('SupplierUtils'); ga.addParam('sysparm_name', 'getSupplierDetails'); ga.addParam('sysparm_supplier_id', supplierID); ga.getXMLAnswer(function(response) { var details = JSON.parse(response); // Use setValue to populate AND save the fields g_form.setValue('supplier_address', details.address); g_form.setValue('supplier_phone', details.phone); g_form.setValue('supplier_email', details.email); g_form.setValue('supplier_contact', details.contact); }); }
Hello i hope that can help
If you find this answer useful, please mark it as solution accepted/helpful
Massimiliano Micali