ftos.data.isPersona
IMPORTANT!
Starting with v24.3.0, this is renamed from isPersona to ftos.data.isPersona.
Starting with v24.3.0, this is renamed from isPersona to ftos.data.isPersona.
Checks if a record is associated with a customer persona.
This is a data service method for business service components.
Syntax
Copy
function ftos.data.isPersona(personaName : string, entityId : string): boolean;
| Parameter | Type | Description |
|---|---|---|
personaName
|
string | Name of the customer persona. |
entityId
|
string | Record ID of the target entity instance that you wish to check whether it is associated with the customer persona. |
Return Value
Returns True if the record is associated with the customer persona and False otherwise.
Examples
In this example:
- We check if the current record (ftos. ftos.context.id) is associated with the geniusBillionairePlayboyPhilantropist customer persona.
- If so, we display the "User is associated with the genius-billionaire-playboy-philantropist customer persona." message in the user interface. Otherwise, we display "User is not associated with the genius-billionaire-playboy-philantropist customer persona.".
For more details on how to display messages in the user interface, see ftos.context.response.setMessage.
Copy
if (ftos.data.isPersona('geniusBillionairePlayboyPhilantropist', ftos.context.id)){
ftos.context.response.setMessage('User is associated with the genius-billionaire-playboy-philanthropist customer persona.')
}else{
ftos.context.response.setMessage('User is not associated with the genius-billionaire-playboy-philanthropist customer persona.')
}