Edit Component UI Builder

Balbir_Singh
Tera Expert

Hi All,
There is a drop-down in UI BUILDER, A functionality is require when i click on first table, then list of record of the table should open,

Balbir_Singh_0-1713809995973.png

Thanks

1 ACCEPTED SOLUTION

IbrarA
Giga Guru

Hi @Balbir_Singh

you can implement following steps:

 

create client script and  use this code:

/**

 * @param {params} params

 * @param {api} params.api

 * @param {any} params.event

 * @param {any} params.imports

 */

function handler({

    api,

    event,

    helpers,

    imports

}) {

    var table;

    switch(event.payload.item.id){

         case "incident":

        {   table = "incident";

            break;}

        case "change request":

        {   table = "change_request";

            break;}

       

    }

    api.emit('NAV_ITEM_SELECTED', {

        route: "record",

        fields: {

            table: table,

            sysId: "-1"

        }

    });

}

IbrarA_0-1713899371651.png

 

Create client state:

IbrarA_1-1713899371656.png

 

 

Add your above client script on dropdown events:

IbrarA_2-1713899371660.png

 

ibrar

View solution in original post

1 REPLY 1

IbrarA
Giga Guru

Hi @Balbir_Singh

you can implement following steps:

 

create client script and  use this code:

/**

 * @param {params} params

 * @param {api} params.api

 * @param {any} params.event

 * @param {any} params.imports

 */

function handler({

    api,

    event,

    helpers,

    imports

}) {

    var table;

    switch(event.payload.item.id){

         case "incident":

        {   table = "incident";

            break;}

        case "change request":

        {   table = "change_request";

            break;}

       

    }

    api.emit('NAV_ITEM_SELECTED', {

        route: "record",

        fields: {

            table: table,

            sysId: "-1"

        }

    });

}

IbrarA_0-1713899371651.png

 

Create client state:

IbrarA_1-1713899371656.png

 

 

Add your above client script on dropdown events:

IbrarA_2-1713899371660.png

 

ibrar