Display related record numbers that has the reference value selected in the portal

ss123
Tera Contributor

I want to display the record numbers that has the reference value selected.

For example: 

When a "Key Matter Number" is selected, I want to display the record numbers in the Portal that have this Key Matter Number from the table record.

ss123_0-1740452170564.png

In the table, there are 3 records that has the "Key Matter Number" selected and I want these record numbers to be displayed in the Portal.

ss123_1-1740452290652.png

 

Is this possible?

 

Thank you.

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@ss123 

you can use onChange catalog client script and GlideAjax and then bring the DEAL number and populate in single line text variable

OR

you can also use getReference with callback

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading) {
        return;
    }

    if (newValue == '') {
        g_form.clearValue('dealVariable'); // location variable name here
    }

    var ref = g_form.getReference('u_keyMattervariable', callBackMethod); // variable name
}

function callBackMethod(ref) {
    if (ref.number)
        g_form.setValue('dealVariable', ref.number); // your variable name & field here
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

6 REPLIES 6

Hi @Ankur Bawiskar , I tried using onchange catalog client script and script include and I think it's working. 

But can I display the Deal Record numbers as a hyperlink to the actual record?

 

Thanks.

@ss123 

Glad to know that approach I shared worked

Not possible.

You cannot include link in string variable.

You can show info message if required and form the link and share

If my response helped please mark it correct and close the thread so that it benefits future readers.

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