May 21, 2024

Could not find a property named '_opportunityid_value' on type 'Microsoft.Dynamics.CRM.opportunity'.

In the past couple of weeks, a new bug seems to have cropped up when trying to reference related fields from Dynamics 365 Sales tables.

In a Power Apps Canvas App, it's common to use functionality like this:

First(Orders).Opportunity.Topic

where I'm reference the first Order in the Orders table, look at the Opportunity lookup on that record and get the Topic from that Opportunity. I've done this a lot in the past, across out-of-the-box or custom tables and it generally just works.

However, the above formula now no longer works:

Order to Opportunity error

and displays the error "Error when trying to retrieve data from the network: Could not find a property named '_opportunityid_value' on type 'Microsoft.Dynamics.CRM.opportunity'. In one sense, it's right - there's no field called that on the Opportunity table, but why is it even looking for it?

The same thing happens when trying to reference the relationship between Order Product and Order:

Order Product to Order dataverse error

with the error "Error when trying to retrieve data from the network: Could not find a property named '_salesorderid_value' on type 'Microsoft.Dynamics.CRM.salesorder'

Other relationships work just fine, such as this:

First(Orders).'Created By'.'Full Name'

so it's curious as to what's going on here. However, there is one thing the two errors have in common. The lookup field shares the same logical name as the id field on the related table. So in the first instance, the lookup field on an order is called opportunityid and the id field on the Opportunity table is also opportunityid. For an Order Product, the lookup field is called salesorderid, which is also the same name as the ID field on the Order table. It seems like the Canvas App editor is getting confused by this.

I've currently got an open support case with Microsoft on this issue, so we'll see if anything comes from it.

UPDATE (28/5). I've finally had an answer from Microsoft as to what is causing this. It's all down to this setting:

New Analysis Engine

If this setting is turned off, the problem no longer occurs. Apparently the bug is going to be looked at, but the current workaround is to just switch this setting off for now.

Freezepop.co.uk

Informational site covering the Microsoft Power Platform, including Power Apps, Power Automate and Power BI.