Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to convert str to table name

(1) ShareShare
ReportReport
Posted on by 161
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 230,370 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 161 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 230,370 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans