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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2016 get quote status from quote product form javascript

(1) ShareShare
ReportReport
Posted on by

Hi , could anyone guide me to get quote id from quote product form side javascript. i have tried below using sdk.rest retrieve record but i get error

function on_product_save() {

    var quotedetailid = Xrm.Page.data.entity.getId();
    returnQuoteid(quotedetailid);
//get quote status 
//if draft then do more
}

function returnQuoteid(quotedetailid)
{
    SDK.REST.retrieveRecord(
         quotedetailid,
         "QuoteDetail",
         null, null,
         function (quotedetail) {
             alert("Quoteid :" + quotedetail.quoteid.Value);
         },
         errorHandler
       );

}


this gives me an error  Unable to get property 'Value' of undefined or null reference 

quoteid undefined , can we only read values on form attributes ? 

All I need to do is when user save or load quote product get quote status , if quote status in Draft then check some custom fields values of quote product filled or not .

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Try to use QuoteId instead of quoteid.

  • Community Member Profile Picture
    on at

    no luck :( still undefined , its look like sdk rest read only the attributes in form

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Also try this - quotedetail.QuoteId.Id

    If I'm not wrong you even don't need call Rest. Try to use following code - Xrm.Page.getAttribute("quoteid").getValue()

  • Community Member Profile Picture
    on at

    Andrii's way is working I can confirm. And if you are using this inside of a web resource, don't forget to add window.parent before the .Xrm part.

    Best,

    Georgi

  • Verified answer
    Community Member Profile Picture
    on at

    hi 

    I have tried 

    Xrm.Page.getAttribute("quoteid").getValue(); this return object

    then i tried  

    var qid = Xrm.Page.getAttribute("quoteid").getValue();
    alert(qid[0].id);

    that return quote id thanks 

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    If that worked for you - you can close the thread marking reply as an answer.

  • Community Member Profile Picture
    on at

    thanks Andrii

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

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans