How to receive viewport params sending from record page to subpage which I'm opening as a modal.

bhattahemas
Tera Contributor

I have created a form declarative action ufx client action where I'm not passing any payload from it and created an event record page which opens a subpage as a mod

/**
 * @Param {params} params
 * @Param {api} params.api
 * @Param {any} params.event
 */
function evaluateEvent({
    api,
    event
}) {
    return {
        modalId: "[component-id$='modalContainerViewport']",
        headerLabel: null,
        showModal: true,
        preserveState: false,
        displayOptions: null,
        bare: false,
        viewportElementId: 'modalContainerViewport',
        viewportRoute: 'change_primary_service_modal',
        viewportFields: null,
        viewportParams: {
            sys_id: api.context.props.sysId,
            table: api.context.props.table
        }
    };
}

al and the script I'm attaching below. In the event mapping of declarative action I mapped with the event I created on record page and I'm not passing any payload from the event mapping. I'm passing viewportParams from the event i created on record page and the params are sys_id and table name where I'm passing correct values as api.context.props.sys_id and api.context.props.table. Now I need these two values in my subpage which is getting opened as modal and I need to set the sys_id and table name to client state parameters to work on them in my new page, How can I receive those values in my new page or is there any other alternative for that to access the record sys_id and table name in my new page?

0 REPLIES 0