locked
Error Message - Cannot save view. Returned attributes must not be changed RRS feed

  • Question

  • Hi,



    I have created a view from ‘Advanced Find’ with two attributes – opportunityid and ownerid. The XML code is as follow:-

     

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

      <entity name="opportunity">

        <attribute name="opportunityid" />

        <attribute name="ownerid" />

        <order attribute="ownerid" descending="false" />

      </entity>

    </fetch>

      

    I then opened this view in the XRMTOOLBOX plugin and modified the XML code as below to create an aggregate variable of opportunity count:-

     

    <fetch version="1.0" distinct="false" mapping="logical" aggregate="true" >

      <entity name="opportunity" >

        <attribute name="opportunityid" alias="count_opportunity" aggregate="countcolumn" />

        <attribute name="ownerid" alias="group_owner" groupby="true" />

      </entity>

    </fetch>

     

     

    This has executed successfully in the plugin and generated the correct report. However it wouldn’t allow me to save view in order for me to open in Dynamics. The following error message observed:-

     'Cannot save view. Returned attributes must not be changed'

       

    If I change the XML code to the following to make the names the same, the view can then be saved but it wouldn’t execute.

     

    <fetch version="1.0" distinct="false" mapping="logical" aggregate="true" >

      <entity name="opportunity" >

        <attribute name="opportunityid" alias="opportunityid" aggregate="countcolumn" />

        <attribute name="ownerid" alias="ownerid" groupby="true" />

      </entity>

    </fetch>

     

     

    Can you please advice how I can get round this?

     

    Thank you.

    Monday, November 21, 2016 4:07 PM