Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

RecID - if the returned table record is retrieved

(0) ShareShare
ReportReport
Posted on by 4,125

Hi experts,

Fred Shen: Always use recId to know if a select statement returns a record - DAX Blogs - AXForum

Is this still true in Dynamics 365 FO? Can we use other fields or just as simple as (!custtable)?

Thanks,

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,031 Super User 2025 Season 1 on at
    RE: RecID - if the returned table record is retrieved

    Hi Yuji,

    You already got correct answers above. An additional thought from my side.

    The last example in the blog you shared, containing the count statement, does not look right to me. When you need a count, you never would check if the table or RecID exists. Then you just take the result set to get the count which can be zero as well. Anyway, also here you can use the RecId field to get the count.

    select count(RecId) from purchTable where
        purchTable.purchId == "Do not exist";
        
    info(strFmt("Total count: %1", purchTable.RecId);
    
    if (purchTable.RecId)
    {
        ...
    }
    

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: RecID - if the returned table record is retrieved

    Hi Yuji, It's still applicable in D365 F&O. However,  Field list should be used in select statement for better performance.

    Check this article

    dynamics365musings.com/.../

  • Verified answer
    Alex VN Profile Picture
    Alex VN 1,994 on at
    RE: RecID - if the returned table record is retrieved

    Hi Yuji,

    From my perspective, the same suggestion still applied. You can also have a quick job to test same.

    Regards,

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans