Skip to content

Instantly share code, notes, and snippets.

@anil826
Created November 4, 2019 08:25
Show Gist options
  • Save anil826/089429e5db9c244b24e50d60cdf6c2ae to your computer and use it in GitHub Desktop.
Save anil826/089429e5db9c244b24e50d60cdf6c2ae to your computer and use it in GitHub Desktop.
Update Save record on DFD
$('.finish').on('click', function(e) {
e.stopImmediatePropagation();
//Off the click event
$('.finish').off('click');
var first_name = formyoula.form_fields['ccee-a073-3d63'].get('value');
var last_name = formyoula.form_fields["2e65-9fb3-0133"].get('value')
var user_data = [
{
"typeId":"319013",
"externalId": "000000002",
"data":[
{
"value": first_name,
"fieldId":"319014"
},
{
"value": last_name,
"fieldId":"319015"
}
]
}
]
//Update/save record API
$.ajax({
url: 'https://test.dfg152.ru:8443/dfg-rest/entity/save',
cors: true,
headers: {
'x-auth-token': user_token,
'x-organization': 'Syngenta',
'content-type': 'application/json'
},
data: JSON.stringify(user_data),
method:'POST',
success: function(records){
//Records
console.log(records)
if (records) $(this).click();
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment