locked
SSIS & FetchXML Error RRS feed

  • Question

  • I am using SSIS from Kingsway Soft. I have the XML below. The fetch, entity, attribute was generated by the Dynamics CRM Source object (first define the source type as entity and then switch to FetchXML to get the xml). After that, I added a link to opportunity as I only want leads that are associated with an opportunity (have been converted to an opportunity). However, I am getting the following error:

    "KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmServiceException: CRM service call returned an error: The entityname attribute is not a valid attribute for link-entity(Error Code: -2147217144, Detail Message: The entityname attribute is not a valid attribute for link-entity) (SSIS Integration Toolkit for Microsoft Dynamics CRM, v6.1.0.5366)

    If I remove the filter inside the link-entity the code executes without any error (but not with the expected result). What is wrong with this code? Note that both the source and destination are CRM on Office 365.

    <fetch mapping='logical'>
        <entity name='lead'>
            <attribute name='accountid'/>
            <attribute name='accountidname'/>
            <attribute name='accountidyominame'/>
            <attribute name='address1_addressid'/>
            <attribute name='address1_addresstypecode'/>
             ....
             <link-entity name='opportunity' from='originatingleadid' to='leadid' alias='opp' link-type='outer'>
              <attribute name='originatingleadid'/>
              <filter type='and'>
                <condition entityname='opp' attribute='originatingleadid' operator='not-null'/>
              </filter>
            </link-entity>
            <filter type='and'>
              <condition entityname='lead' attribute='statuscode' operator='gt' value='2' />
            </filter>
        </entity>
    </fetch>



    • Edited by hfaun Tuesday, October 27, 2015 3:44 AM
    Tuesday, October 27, 2015 3:41 AM

Answers

  • Hello,

    Try to use following FetchXml:

    <fetch mapping='logical'>
        <entity name='lead'>
            <attribute name='accountid'/>
            <attribute name='accountidname'/>
            <attribute name='accountidyominame'/>
            <attribute name='address1_addressid'/>
            <attribute name='address1_addresstypecode'/>
             ....
             <link-entity name='opportunity' from='originatingleadid' to='leadid' alias='opp' link-type='outer'>
              <attribute name='originatingleadid'/>
              <filter type='and'>
                <condition attribute='originatingleadid' operator='not-null'/>
              </filter>
            </link-entity>
            <filter type='and'>
              <condition attribute='statuscode' operator='gt' value='2' />
            </filter>
        </entity>
    </fetch>


    Dynamics CRM MVP
    My blog

    • Marked as answer by hfaun Tuesday, October 27, 2015 4:08 PM
    Tuesday, October 27, 2015 7:50 AM
    Moderator

All replies

  • Hello,

    Try to use following FetchXml:

    <fetch mapping='logical'>
        <entity name='lead'>
            <attribute name='accountid'/>
            <attribute name='accountidname'/>
            <attribute name='accountidyominame'/>
            <attribute name='address1_addressid'/>
            <attribute name='address1_addresstypecode'/>
             ....
             <link-entity name='opportunity' from='originatingleadid' to='leadid' alias='opp' link-type='outer'>
              <attribute name='originatingleadid'/>
              <filter type='and'>
                <condition attribute='originatingleadid' operator='not-null'/>
              </filter>
            </link-entity>
            <filter type='and'>
              <condition attribute='statuscode' operator='gt' value='2' />
            </filter>
        </entity>
    </fetch>


    Dynamics CRM MVP
    My blog

    • Marked as answer by hfaun Tuesday, October 27, 2015 4:08 PM
    Tuesday, October 27, 2015 7:50 AM
    Moderator
  • Andrii, that solved my problem. Thank you!!
    Tuesday, October 27, 2015 4:08 PM