Announcements
So i want to replace Entity in the code below with any variable passed
DMFEntity::findFirstByTableId(tableNum(Entity)).TargetEntity
So what is the type of variable i can pass ?
You can't pass variables inside tableNum() function.
Could you perhaps share some context for your question and tell us what you are trying to achieve? Then we can most likely provide some useful assistance. How is your code called? What information is included in the caller process? You can call DMFEntity::findFirstByTableId function with any table id.
For example, there is a function that accepts table name and returns an id of it.
Thanks!
Not Sure what you are looking for here. But if you are looking to find the target entity name for a given entity, you can pass a variable of type Common.
Common common; DMFEntity::findFirstByTableId(common.TableId).TargetEntity
Hi JuniorAX,
tableNum is a compiler-time function, so you can't pass any parameter in runtime to it.
You can use tablename2id function to convert string entity name (aot name) to id or you can use entity name and static function DMFEntity::getTableId to get table is by user-friendly entity name.
docs.microsoft.com/.../xpp-compile-time-functions
docs.microsoft.com/.../xpp-reflection-run-time-functions
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 612
André Arnaud de Cal... 592 Super User 2026 Season 1
Abhilash Warrier 586 Super User 2026 Season 1