Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.WebApi.retrieveRecord

(0) ShareShare
ReportReport
Posted on by

an anyone identify why this works (I see result.defaultpricelevelid.pricelevelid in an alert())--
        Xrm.WebApi.retrieveRecord("account", accountid, "?$select=name,_new_universalterritoryid_value&$expand=defaultpricelevelid($select=pricelevelid,name)").then(
...and yet this one skips directly to the error call back--
        Xrm.WebApi.retrieveRecord("new_universalterritory", UTid, "?$select=new_name,_new_regionid_value&$expand=new_defaultpricelevelid($select=pricelevelid,name)").then(
The error.message is actually empty.  The FormNotification contains only my constant text.

They look syntactically identical to me.  All the lookups and values exist/are populated.

thanks for looking

ps- if I remove the &$expand statement from the second, new_name comes back fine.

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Xrm.WebApi.retrieveRecord

    re: alternative & data/name being wrong:

    I refactored with the alternative _new_defaultpricelevelid_value and _new_defaultpricelevelid_value@OData.Community.Display.V1.FormattedValue actually returns the name of the associated price list

    but, thanks anyway!

    ps- I'm still interested in finding out that it's me and not Microsoft

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Xrm.WebApi.retrieveRecord

    Even the  code looks similar  but there should be something wrong , either field name or the data with the id which you are retrieving is not available.I would suggest to use CRMRestBuilder to build your query. 

    Download the tool , watch here if you are not familiar with CRMRestBuilder.

    https://www.youtube.com/watch?v=VgumdjLd57E

  • ajyendra Profile Picture
    1,738 on at
    RE: Xrm.WebApi.retrieveRecord

    Hi,

    Try it to using fetchxml 

  • Community Member Profile Picture
    on at
    RE: Xrm.WebApi.retrieveRecord

    as the second query is for a custom entity, new_universalterritory, all its custom fields, e.g. new_defaultpricelevelid, also get the prefix.

    the final select statements are identical because both are price list lookups -- that's part of the mystery!

  • Joana Pinto Profile Picture
    740 on at
    RE: Xrm.WebApi.retrieveRecord

    Hi,

    In the second statement, the expand entity you have is new_defaultpricelevelid and not defaultpricelevelid, is this correct? Shouldn't it be defaultpricelevelid?

    Because I saw the new_ prefix and I thought that maybe that could be the mistake.

  • Community Member Profile Picture
    on at
    RE: Xrm.WebApi.retrieveRecord

    just verified transactioncurrencyid on account, uTerritory and both price lists is USD, so there should be no violation of that mystery relationship

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans