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)

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

I have the same question (0)
  • Community Member Profile Picture
    on at

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

  • Joana Pinto Profile Picture
    740 on at

    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

    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!

  • ajyendra Profile Picture
    1,738 on at

    Hi,

    Try it to using fetchxml 

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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

  • Community Member Profile Picture
    on at

    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

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