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 :
Microsoft Dynamics CRM (Archived)

Retrieve latest quote - Early bound entity model C#

(0) ShareShare
ReportReport
Posted on by

I am using early bound entity model to retrieve the quote.

var result = xrm.QuoteSet.Where(a => a.QuoteNumber.Equals(quoteNumber)).ToList();

if (result.Count > 0)
            {
                var quote = result[0];
                Console.WriteLine(quote.RevisionNumber);
                Console.WriteLine(quote.TotalAmount);
                Console.WriteLine(quote.DiscountPercentage);
            }


This always returns the older revision of the quote.  I tried for the latest quote revision by including the revision number in the query and works fine.

var result = xrm.QuoteSet.Where(a => a.QuoteNumber.Equals(quoteNumber) && a.RevisionNumber.Equals(7)).ToList();

Please let me know the way to get the latest revision of the quote.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Royal King Profile Picture
    27,686 on at

    include order by  in your query to order result by revision number or created on  that should get you latest quote

    Example

    var result = xrm.QuoteSet.Where(a => a.QuoteNumber.Equals(quoteNumber)

    orderby  a.RevisionNumber

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans