12
Views
2
Comments
Determine Entity name from ID

I am writing a function that returns a status code of a record that I would like to use across many entities since the logic is similar.
In wanting to keep it simple to use AND a function (instead of a server action) I would like to only have the record Id as an input, then figure out what Entity to look at.  I know that I can make it work by passing in both the Entity AND the ID, but if I can, I'd like to use just the ID.

Does anybody know of a system or other method to determine Entity name for a given ID?  It's possible in a few other platforms, but not all and I have not seen anything in OutSystems that stands out. 

Rank: #541

Hi Dean,

I think it is not possible when using integer value IDs, because there is no way to choose the start number. Nonetheless, you could use text ID and provide some characters just for recognition. However, you will need to implement the logic to handle the uniqueness of the ID.

Other think that might work is that you can concat you ID with some characters and pass this string to the function, e.g:

IdentifierToText(Entity.Id) + "_CL"

Best regards.

Rank: #297

HI Dean 

I'm sorry,  I don't know what you want to do achieve.

What kind of algorithm do you want to use to determine the Entity name by just a record id?
It's not possible for the system to determine.

Please provide more detailed information.

Kind Regards,