Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

How to convert str to table name

Posted on by 112
Hi Team,
 
Str tableName = 'CustTable'
In string i am having the table name CustTable and in custTable i am having one 'Test' field, i would like to check that 'Test' field is present in CustTable or not.
 
Please let me know how to achieve this.
 
 
Thanks,
  • Martin Dráb Profile Picture
    Martin Dráb 228,501 Most Valuable Professional on at
    How to convert str to table name
    Please don't change the topic; create a new thread for the other requirement.
     
    Regarding the check whether the table has the Test field or not, is your question answered. If so, please verify the answer. If not, please tell us what doesn't work for you.
  • CU21091228-0 Profile Picture
    CU21091228-0 112 on at
    How to convert str to table name
    Thanks for your reply,
     
    Here Test is a Enum value which store No::Yes elements, i would like to check total how many records are with Yes and total records with No.  
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,501 Most Valuable Professional on at
    How to convert str to table name
    Use can usie fieldName2Id(tableName2Id(tableName), 'Test') and check if it returns a non-zero value.
     
    Another option is DictTable.fieldName2Id().

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans