In Agent workspace,g_modal.showfields we use .then and give code to execute if the user clicks OK button , Can you help me what function we need to use to give the code when the user clicks Cancel

Vinodhini
Kilo Contributor

In Agent workspace,g_modal.showfields we use .then and give code to execute if the user clicks OK button , Can you help me what function we need to use to give the code when the user clicks Cancel

6 REPLIES 6

My colleague found a way to reload the form when the user clicks on "cancel" or "X".

You just need to add this piece of code to your .then section:

g_modal.showFields({
title: "Complétez les champs obligatoires pour poursuivre",
fields: fields,
size: 'lg'
}).then(
function(fieldValues) {
g_form.setValue('close_code', fieldValues.updatedFields[0].value);
g_form.setValue('close_notes', fieldValues.updatedFields[1].value);
g_form.save();
},
function(error) {
location.reload();
});

Hello @Ankur Bawiskar 

How to use the code for type glide_list of field watch_list,.