Retrieving Values for Reference Variable in RITM

Abbey Brown
Kilo Explorer

Hello all, 

Fairly new to SN. I am trying to retrieve the values for a reference variable on an RITM. Any suggestions or links would be much appreciated. I've seen getReference() which isn't working. I am trying to retrieve reference value for Employee Name, which is a sys_user reference. 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

You can dot-walk the values on that reference field:

current.variables.employee_name.name.getValue()
OR
current.variables.employee_name.email.getValue()

Something like that. Is there specific data you are attempting to retrieve from that reference field? Can you please elaborate on your use case?

View solution in original post

5 REPLIES 5

shloke04
Kilo Patron

Hi,

It depends where you are trying to retrieve the value of a Reference Variable. Please see the steps below to achieve your requirement:

1) Server side: Can be a Business Rule, or a Workflow then you need to use the syntax as below:

current.variables.VariableName (Assuming BR is on RITM or Catalog Task Table)

2) If it is a client Side Operation then you can use getReference as shown below in an On Change script for example as below:

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var getVarValue = g_form.getReference('variables.VariableName', getRefValue); // Replace your Variable Name here

    function getRefValue(getVarValue) {
        alert(getVarValue.name); //name is just an example you can replace it with any other field name
        alert(getVarValue.email);
    }

    //Type appropriate comment here, and begin script below

}

 

There are other methods available as well through which you can retrieve the Reference Variable Value. You need to elaborate on what you are looking for and someone from community can assist you to get to a solution.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke