How to add get parentSysId to the Link to Destination event handler

Annette Kitzmil
Tera Guru

Hello,

This is probably a simple question for some, but I can't seem to figure this out.  I have created a uxf declarative action for a related list.  This has an add on event mapping to a handled event in ui builder that is mapped to a link to destination event.  Below is my current script, but I need to pass the parent record sys_id so that I am able to prefill the fields on the form that is getting opened up as most of the fields are coming from the parent table on the child record form that is being opened.  I was trying to set this up so that the parent sysId gets passed in the URL so I could use it for a business rule to prefill the values.  So two questions please.

1) how do I update the script below so it passes the parent record sysId which is the page I am on when the button is getting clicked on the related list?

2) Is there a better method for prefilling the values on the child record page from the parent record than a Business Rule?

 
function evaluateEvent({api, event}) {
    return {
        route: "sip-infraction-record",
        fields: {
        sysId: "-1" ,
        table: "x_mtbr_ebs_sip_0_sip_infractions"
    },
        params: {
        fields: null ,
        query: null ,
        route: "sip-infraction-record"
    },
        redirect: null,
        passiveNavigation: null,
        title: null,
        multiInstField: null,
        targetRoute: null,
        external: null,
        navigationOptions: null
    };
}

 

Thanks,

Annette

 

0 REPLIES 0