The CreatorCon Call for Content is officially open! Get started here.

worskpace ui action

siham majdalan3
Tera Contributor
Hello , i wrote this script in worskpace client script in a ui action but in the window i can't display the label "Do you want to continue?" what's the problem? 
function onClick(g_form) {
var poursuivreText = 'Voulez-vous poursuivre?';
    var fields = [
{
            type: 'Label',
            name: 'poursuivre_label',
            label: 'Voulez-vous poursuivre?',
        },
  
        {
            type: 'choice',
            name: 'reason_code',
            label: 'Motif d\'annulation',
            value: getMessage(' -- None -- '),
            mandatory: true,
            choices: [
                {
                    displayValue: 'Annulé par le demandeur_Indisponibilité',
                    value: '1'
                },
                {
                    displayValue: "Annulé par l'opérateur_ Reprogramation avec le demandeur ",
                    value: '2'
                },
                {
                    displayValue: "Annulé par l'opérateur_ Demandeur Absent",
                    value: '3'
                }
            ],
 
        },
 
    ];
 
    g_modal.showFields({
        title: "Annulation de RDV",
        fields: fields,
        size: 'lg',
        cancelTitle: 'Cancel', // Custom text for the Cancel button
        confirmTitle: "Confirmer l'annulation du RDV", // Custom text for the OK button
    }).then(function (fieldValues) {
        g_form.setValue('state', 'cancelled');
        g_form.setValue('u_cancel_reason', fieldValues.updatedFields[1].value);
        g_form.save();
    });
}
6 REPLIES 6

@siham majdalan3 

it seems that type is not supported

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

mlee
Tera Expert

I believe the supported type are textarea, choice, reference, boolean, and string.

 

See this (https://www.servicenow.com/community/next-experience-articles/how-to-use-ui-actions-in-workspaces/ta...) for additional details.