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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

RecID - if the returned table record is retrieved

(0) ShareShare
ReportReport
Posted on by 4,131

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,

I have the same question (0)
  • Verified answer
    Alex VN Profile Picture
    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,

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator 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/.../

  • André Arnaud de Calavon Profile Picture
    300,721 Super User 2025 Season 2 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)
    {
        ...
    }
    

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans