locked
Need to get activities related to originating lead as wel using fetch xml RRS feed

  • Question

  • Hello Experts,

    How to create the filter condition using fetch xml, similar to screen shot below.  Which shows all the activities related to opportunity and originating lead.

    Below is the fetch xml which gave all opportunities related only to opportunity.

    <fetch>
      <entity name="opportunity" enableprefiltering="1">
        <attribute name="customerid" alias="customerid" />
        <attribute name="name" alias="name" />
        <attribute name="new_nextstep" alias="nextstep" />
        <attribute name="opportunityid" alias="opportunityid" />
       <attribute name="originatingleadid" alias="originatingleadid" />
        
        <link-entity name="activitypointer" from="regardingobjectid" to="opportunityid" link-type='inner' alias="activityLink">
    
        <attribute name="activitytypecode" />
        <attribute name="regardingobjectid" />
        <attribute name="subject" alias="subject" />
        <attribute name="statuscode" alias="statuscode" />
        <attribute name="statecode" alias="statecode" />
        <attribute name="activitytypecode" alias="activitytypecode" />
        <attribute name="activityid" alias="activityid" /> 
        <attribute name="description" alias="description" />
        <attribute name="prioritycode" alias="prioritycode" />
    
        </link-entity>
    </entity>
    </fetch>

    But the requirement is to show the activities related to originating lead as wel. So i tried to filter like this,

    <filter type="or">
      <condition attribute="regardingobjectid" operator="eq" value="originatingleadid"/>
      </filter>

    within <link-entity>. This is not working. Can you anyone help me in knowing how to add filter condition so that the activities related opportunity and originating lead both will be displayed.

    Thank you


    Thanks and Regards. MadhuSudhan M


    • Edited by Madhu-CRM Wednesday, July 17, 2013 9:30 AM To explain the requirement clearly
    Wednesday, July 17, 2013 8:05 AM

Answers