Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sean-OReilly
Helper IV
Helper IV

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.

 

1 ACCEPTED SOLUTION
Mich00
New 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 🙂 

     

View solution in original post

6 REPLIES 6
Mich00
New 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 🙂

Mich00
New 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 🙂 

     

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

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 🙂

Thank you so much @Mich00 

this 100% worked - i don't think I would have ever solved this without you.

THANK YOU 

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.