Multi Row Variable Set - Call back on Service Portal

Daniel Bartholo
Tera Contributor

Hi,

I am looking for assistance please?

I have a form with a multi row variable set included. The form has two options:

1. Create new

2. Amend

 

When people click Amend they can selected a previous request that will bring back all the variables value directly on the form. I have this working fine for the individual variables on the form however, I am wondering if it is possible to call back the MRVS (including the row and variable data)?

 

You will see in the screenshot I am able to select an RITM and it will bring back some of the variables but not the MRVS variable rows and data.

Right now I have the following Scripts applied:

Catalog Client Script

//FORM FIELDS
    var formFields = new GlideAjax('getFormDesignFields');
    formFields.addParam('sysparm_name', 'getFormFields');
    formFields.addParam('sysparm_user', ritm);
    formFields.getXML(checkFFields);

    function checkFFields(response) {
        var ritmFFields = response.responseXML.documentElement.getAttribute("answer");
        if (ritmFFields != '') {
            g_form.setValue('form_builder_form_fields', ritmFFields);
        }
    }
 
Script Include
//FORM DESIGNER FIELDS
    getFormFields: function() {
        var ritm = this.getParameter('sysparm_user');
        var ritmFFields = "";

        var gr = new GlideRecord("sc_req_item");
        gr.addQuery('sys_id', ritm);
        gr.query();
        if (gr.next()) {
            ritmFFields = gr.variable_pool.form_builder_form_fields; //gr.getDisplayValue('department');

        }
        return ritmFFields;

    },
0 REPLIES 0