Unable to load data from Dynamics 365 CRM sales table to MS-SQL

Advait Bhujbal 0 Reputation points
2024-03-10T10:46:15.3633333+00:00

I was trying to load data from Dynamics 365 Sales to MS-SQL using Using Azure Data Factory Copy data tool, Metadata-driven copy task. The type of load I am using is Delta Load/Incremental Load.
Facing this issue:

Failure happened on 'Source' side. ErrorCode=DynamicsOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Dynamics operation failed with error code: DynamicsOperationFailed, error message: The Fetch Xml query specified is invalid..,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,''Type=System.Xml.XmlException,Message=Data at the root level is invalid. Line 1, position 1.,Source=System.Xml,'

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,545 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Amira Bedhiafi 15,216 Reputation points
    2024-03-10T14:30:55.8833333+00:00

    The error The Fetch Xml query specified is invalid indicates that the fetch query is invalid.

    https://stackoverflow.com/questions/75525027/how-to-construct-a-fetch-query-to-fetch-all-fields-in-dynamic-crm-table-with-azu


  2. ShaikMaheer-MSFT 37,896 Reputation points Microsoft Employee
    2024-03-28T10:03:10.77+00:00

    Hi Advait Bhujbal,

    Thank you for posting query in Microsoft Q&A Platform.

    The error message you are receiving indicates that the FetchXML query specified in the Dynamics 365 Sales source is invalid. This error can occur if the FetchXML query is not properly formatted or if it contains invalid characters.

    To resolve this issue, you can try the following steps:

    Check the FetchXML query. Make sure that the FetchXML query is properly formatted and that it does not contain any invalid characters. You can use the FetchXML Builder tool in Dynamics 365 Sales to create and test the FetchXML query.

    Check the connection to Dynamics 365 Sales. Make sure that the connection to Dynamics 365 Sales is properly configured and that you have the necessary permissions to access the data.

    Check the metadata-driven copy task. Make sure that the metadata-driven copy task is properly configured and that it is using the correct FetchXML query.

    Check the data type mapping. Make sure that the data type mapping between Dynamics 365 Sales and MS-SQL is correct and that it can handle the data being transferred.

    Check the incremental load settings. Make sure that the incremental load settings are properly configured and that they are using the correct FetchXML query.

    If none of the above steps resolve the issue, you can try to recreate the metadata-driven copy task or contact Microsoft support for further assistance.


  3. Pinaki Ghatak 2,320 Reputation points Microsoft Employee
    2024-04-26T08:26:40.6533333+00:00

    Hello @Advait Bhujbal

    To resolve this issue, you need to fix the error in the Fetch XML query. You can refer to the Dynamics 365 Sales documentation to learn more about how to create a valid Fetch XML query.

    0 comments No comments