web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to pass variable inside tableNum?

(0) ShareShare
ReportReport
Posted on by 1,552

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 ?

I have the same question (0)
  • nmaenpaa Profile Picture
    101,172 Moderator on at

    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!

  • Gunjan Bhattachayya Profile Picture
    35,429 on at

    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

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,097 on at

    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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 612

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 592 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 586 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans