ebs.getLookupTextValue
Returns the display value of a lookup attribute of the form's source entity.
This method allows you to retrieve the values of lookup attributes as they are displayed in the user interface. The real value of a lookup attribute is the primary key of the corresponding record of the lookup entity, while the value displayed in the user interface is that record's primary attribute. This makes the regular methods of retrieving attribute values, such as formData.model, inadequate for most cases when lookup attributes are involved.
Syntax
Copy
function ebs.getLookupTextValue(attributeName: string): any
| Parameter | Type | Description |
|---|---|---|
attributeName
|
string | The name of the lookup attribute whose display value you want to return. |
Response
Returns the attribute's display value.
Exapmples
In this example:
- We check if the user selected Nebraska for state lookup attribute displayed on the current form.
- If so, we display the following message: Sorry. We do not support mail orders for Nebraska. For details on how to display messages, see ebs.showMessage.
Copy
if (ebs.getLookupTextValue('state') == 'Nebraska'){
ebs.showMessage('Sorry. We do not support mail orders for Nebraska.')
}