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
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
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.
Hi,
Try it to using fetchxml
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!
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.
just verified transactioncurrencyid on account, uTerritory and both price lists is USD, so there should be no violation of that mystery relationship
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6