Entity Identifier & Expression

Entity Identifier & Expression

  
When working with an entity Identifier & using expressions:

#1 If Entity1 has Attribute "Code" (Text) as its identifier
You can not use the expression
Entity1.Code="UK"

It will produce an error as it requires an identifier value not a text value.

#2 If Entity2 has Attribute "Id" (Integer) as its identifier
You can not use the expression
Entity2.Id="11"

It will produce an error as it requires an identifier value not a integer value.


The question is, is there a converter function, that can be used to solve this issue OR I will need to query the ENTITY to first find the Text or Integer value then assign the identifier.
You can use the builtin functions IntegerToEntityRefInteger() & TextToEntityRefText(). They're in the folder DataConversion of the expression editor's tree

Best Regards,
Gustavo Guerra
Thanks Gustavo,


what about check "Entity Identifier" for null?

Hi Robert

 

Try comparing against NullIdentifier() and NullTextIdentifier(). See also About Null Values.

 

Cheers,

Hi...
      How can i convert a text to EntityIdentifier....?
Hi Nandhini,

ovatsus posted the answer above :) 

TextToEntityRefText()
Also, you necromanced a thread that's over six years old! That's not the way to go... That said, with Platform 9.1 Bali, it's no longer "TextToEntityRefText()", but "TextToIdentifier()".
Hi all:)
    Thanks for the reply....:) I tried with "TextToIdentifier()" It returns "Text Identifier". I have  a table "Employee details" . I have the user name in the text field(fetched using session username). I have to convert it to "Employee details Identifier"...Is it possible to do....?

Hi Nadhini,

I'm not sure what you mean. If you mean you need, based on the entered name, the accompanying Id in a table, you need to make an Aggregate that has a filter on the user name.