locked
Issue with RetrieveMultiple and CRM Mobile App? RRS feed

  • Question

  • Hello,

        I have written a plugin that intercepts the RetrieveMultiple method (pre-operation) when the Activities subgrid on the Account form is loaded. The plugin modifies the QueryExpression to include child accounts, so the list of activities is expanded to include the activities from the Account and its children. I'm using CRM Online (2015 Update, version 7.1.4461).

    This works properly when accessing CRM from a browser (I'm using IE) but when I use the CRM mobile app, the Activities subgrid on the Account form only shows activities related to the Account (not its children). I have been playing around with the FetchXML and have my plugin creating it (see below) and when I run it outside of CRM (I'm creating a quick SSRS report to preview the query), it returns the correct amount of records.

    Can someone please help? I don't understand why the query that I modify works in an SSRS report fine but not from the CRM app for Tablets? Here is the FetchXML:

    <fetch distinct="false" no-lock="false" mapping="logical" page="1" count="25" returntotalrecordcount="true">
      <entity name="activitypointer">
        <attribute name="subject" />
        <attribute name="activitytypecode" />
        <attribute name="regardingobjectid" />
        <attribute name="prioritycode" />
        <attribute name="scheduledend" />
        <attribute name="createdby" />
        <attribute name="statecode" />
        <attribute name="activityid" />
        <attribute name="scheduledstart" />
        <filter type="and">
          <condition attribute="regardingobjectid" operator="in">
            <value>{798E2F7B-197C-E511-80DD-3863BB2EA878}</value>
            <value>{9BED6457-D7A2-E511-80ED-3863BB2EA878}</value>
            <value>{8D68B3E7-C3A8-E511-80EE-3863BB2EA878}</value>
            <value>{CD5B68A6-C9A8-E511-80EE-3863BB2EA878}</value>
            <value>{5879386D-FAA8-E511-80EE-3863BB2EA878}</value>
            <value>{5E314698-D7A2-E511-80F7-3863BB2EC1E8}</value>
            <value>{1AAE7C8A-F19D-E511-80E7-3863BB368B18}</value>
            <value>{A513B66C-F29D-E511-80E7-3863BB368B18}</value>
            <value>{1149FD1E-37E6-E511-80F0-3863BB368B18}</value>
            <value>{59DDC90A-F29D-E511-80E7-3863BB368B18}</value>
            <value>{E40913CA-38E6-E511-80F0-3863BB368B18}</value>
            <value>{094BA55F-F19D-E511-80E7-3863BB368B18}</value>
          </condition>
          <filter type="and">
            <condition attribute="isregularactivity" operator="eq" value="1" />
            <condition attribute="statecode" operator="in">
              <value>2</value>
              <value>1</value>
              <value>0</value>
              <value>3</value>
            </condition>
          </filter>
          <filter type="and">
            <filter type="or">
              <condition attribute="activitytypecode" operator="eq" value="10008" />
              <condition attribute="activitytypecode" operator="eq" value="10013" />
              <condition attribute="activitytypecode" operator="eq" value="10014" />
              <condition attribute="activitytypecode" operator="eq" value="10022" />
              <condition attribute="activitytypecode" operator="eq" value="4202" />
              <condition attribute="activitytypecode" operator="eq" value="4210" />
              <condition attribute="activitytypecode" operator="eq" value="4212" />
              <condition attribute="activitytypecode" operator="eq" value="4216" />
              <condition attribute="activitytypecode" operator="eq" value="4201" />
            </filter>
          </filter>
        </filter>
        <order attribute="scheduledend" descending="false" />
      </entity>
    </fetch>

    Thanks,

    John

    Monday, March 21, 2016 2:02 PM