Forum Discussion
Need Help - Data source error - The OData connector failed
Hi
My Power Bi dataset is not refreshing as a result of the below error:
Data source errorExpression.Error: The OData connector failed with the following error: We cannot convert the value null to type Record... . The exception was raised by the IDbCommand interface. Table: MK_CS_Ledger
The dataset has been working & resfreshing every couple of hours for months and this error never came up.
If I delete the above table from my model, the same error comes up but it makes reference to a different Table.
The tables in question all belong to Microsoft Dynamics Business Central system.
How do I fix this and/or get more information about what is causing my error.
Hi Sean-OReilly ,
The latest version of the connector no longer permits the 4th parameter to be null within the source (Source = Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, null), .
To fix this you will need to change the last 'null' to '[UseReadOnlyReplica = null]' within the Advanced Editor.
- Open the powerbi desktop report
- Select Transform data
- Select and highlight your Business Central related query
- Open Advanced editor
- Replace the last 'null' with '[UseReadOnlyReplica = null]'
- Ok
- Close & Apply once updated to all BC related queries
EG:
Before:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, null)After:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null])Hope this helps 🙂
6 Replies
- Mich00New Member
Hi Sean-OReilly ,
The latest version of the connector no longer permits the 4th parameter to be null within the source (Source = Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, null), .
To fix this you will need to change the last 'null' to '[UseReadOnlyReplica = null]' within the Advanced Editor.
- Open the powerbi desktop report
- Select Transform data
- Select and highlight your Business Central related query
- Open Advanced editor
- Replace the last 'null' with '[UseReadOnlyReplica = null]'
- Ok
- Close & Apply once updated to all BC related queries
EG:
Before:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, null)After:
Dynamics365BusinessCentral.ApiContentsWithOptions(null, null, null, [UseReadOnlyReplica = null])Hope this helps 🙂
- varietygrantFrequent Visitor
Wow - thanks for that answer! Did Microsoft announce this? We'll now have a bunch of work to do updating all of our data sources to BC. Hard to keep up with Microsoft these days.
- Sean-OReillyHelper IV
Thank you so much Mich00
this 100% worked - i don't think I would have ever solved this without you.
THANK YOU
- MarcoBCSoftNew Member
Hi Mich00,
I still haven't resolved the issue as I don't have any powerBI reports saved but I was keen on building one.
When I click on Transform data and I select D365 Business Central I do not get the possibility of clicking Advanced Editor and I can only modify permissions.
Can you please help?
Thank you,
Marco
- Mich00New Member
Hi MarcoBCSoft . To access the 'Advanced Editor' you will need to have selected the source(s) required and then once you are in the 'Transform Data' editor you will have an option on the top banner (Home tab/'Query' section) for the 'Advanced Editor' settings. Hope this helps and have fun creating reports 🙂
- Mich00New Member
varietygrant to be honest I'm not sure if MS announced this as I dont receive the comms and cannot see anything online, I'm fairly new to BI and non IT but love techy stuff. I had this issue with some of my BI reports so did a bit of research and came across this solution, worked for me so thought I'd share. Good luck 🙂