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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

CustInvoiceJour index

(2) ShareShare
ReportReport
Posted on by 1,979
Hi,

In CustInvoiceJour table, the allow duplicate No index is (InvoiceId, InvoiceDate, NumberSequenceGroup, RecId)

Can someone please explain to me the benefit of adding RecId to the index?

As RecId alone should be enough to provide uniqueness.

I know that sometimes we add fields to the index in case we have select statements where we filter by those fields alot. But i think if someone has the RecId then there won't be need to to filter on InvoiceId, InvoiceDate, NumberSequenceGroup
And I don't think there are "where" statements looking at RecId


Same thing for SalesLine
Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    238,782 Most Valuable Professional on at
    You're right that if you know RecId, you don't need the other fields. But the reason for including RecId may be different. Imagine that you have a query where you filter by InvoiceId and InvoiceDate and return NumberSequenceGroup and RecId. If you have all the field in an index, you don't have to look into the table at all, therefore it's very efficient.
  • André Arnaud de Calavon Profile Picture
    303,383 Super User 2026 Season 1 on at
    Hi ..,

    Did the reply from Martin helped you with your answer? It will be great if you can provide us with an update if his reply answered your question.
  • Suggested answer
    Anthony Blake Profile Picture
    3,070 Super User 2026 Season 1 on at
    This of the Index as looking for a name in the directory. The order the fields is very important for optimisation, and the order they are in your example represents the most common usage for this table, so a search by Invoice number is the most common. If this is the clustered index in SQL, it is the physical ordering of the data, so super fast. RecId will be added to the end of the query to ensure uniqueness, and for no other reason here. It's all about optimised performance for the typical usage of this specific table.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans