g_modal - Is there any documentation? What can we change in the modal dialog?

Michael Chang1
Tera Guru

Hi, recently Im build a workspace for a new application using AES, and want to add a new UI action. So came across this g_modal that allow us to prompt confirmation or a form in dialog, but the documentation no where to be found except some blogs and article out there. 

1. Does SNOW publish an official documentation how we can use g_modal?

2. How can I change the button title for the confirm button in g_modal.confirm?

find_real_file.png

 

3. or, how can i add some text between the title and the fields in g_modal.showFields?

find_real_file.png

6 REPLIES 6

Amitoj Wadhera
Kilo Sage

Hi,

You can try this:

In the below code these attributes are responsible for changing the Labels for 'Ok' and 'Cancel' buttons.

cancelTitle: getMessage('Cancel the Operation'), // changing the label of cancel button
confirmTitle: getMessage('Confirm'),  // changing the label of Ok button

 

 

 g_modal.showFields({
        title: "Updating Server Short Description",
        fields: fields,
        size: 'lg',
        cancelTitle: getMessage('Cancel the Operation'), // changing the label of cancel button
        confirmTitle: getMessage('Confirm'),  // changing the label of Ok button
        cancelType: 'default',
        confirmType: 'confirm'
    }).then(function(fieldValues) {
        g_form.setValue('short_description', fieldValues.updatedFields[0].value);
        g_form.setValue('support_group', fieldValues.updatedFields[1].value);
        g_form.setValue('due_in', fieldValues.updatedFields[2].value);
        g_form.save();

    });

Kind Regards,

Amitoj Wadhera

 

Please Mark helpful if this works.

MuraliKChintha
Tera Expert

Hi,

 

This code might be helpful to you.

 

function onClick(g_form) {

    g_modal.showFields({
        title: getMessage('Confirmation'), // title of modal popup
        instruction: getMessage('Do you want to cancel this Profile?'),
        size: 'md',
        cancelTitle: getMessage("No"),
        confirmTitle: getMessage("Yes"),
        cancelType: "default",
        confirmType: 'confirm'
    }).then(function(fieldValues) {
		
        g_form.save();

    });
}