How to get a dynamic choiceList for a field while creating a g_modal for a CSM/FSM Workspace?

Ahsan Zafar
Tera Contributor

I'm creating a modal for Service case table where I have one dropdown choicelist field and other is the textarea. I defined g_scratchpad in a business rule to get all the choices for the field which I further used successfully for the classic UI. Now the question is how can I use this g_scratchpad for the Workspace client script as well??

//Workspace Client Script

function onClick(g_form) {
   
    var fields = [
        {
            type: 'choice',
            name: 'resolution_code',
            label: getMessage('Resolution Code'),
            value: getMessage(' --None-- '),
            //choices: JSON.parse(g_scratchpad.resolutionCodeChoices),
            mandatory: true
        },

//Thankyou..

7 REPLIES 7

@Ankur Bawiskar I'm facing an errors inn script include.

@Ahsan Zafar 

did you check what came in alert from script include?

what debugging have you done so far?

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

@Ahsan Zafar 

any update on this?

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