locked
FetchXML result problem RRS feed

  • Question

  • Hi,

    this is a function contains FetchXML request to get the won opportunity sum of each Sales agent, the result of this request:

    show me the same won opportunity some for all sales agent !

     function Request_GetWonOpportunityBySalesAndQuarter(SalesName, QuarterPeriod)
                {
                    var FetchXml = '<fetch distinct="false" mapping="logical" aggregate="true" output-format="xml-platform" >' +
                        '<entity name="opportunity" >' +
                        '<attribute name="actualvalue" alias="opportunity_sum" aggregate="sum" />' +
                        '<filter type="and" >' +
                        '<condition attribute="createdbyname" operator="eq" value="' + SalesName + '" />' +
                        '</filter>' +
                        '<filter type="and" >' +
                        '<condition attribute="statecode" operator="eq" value="1" />' +
                        '</filter>'+
                        '<filter type="and" >' +
                        '<condition attribute="actualclosedate" operator="in-fiscal-period" value="'+ QuarterPeriod +'" />' +
                        '</filter>' +
                        '</entity>' +
                        '</fetch>';
    
                    return FetchXml;
                }

    Any idea please.


    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

    Wednesday, April 8, 2015 3:34 PM

Answers

  • the solution :>

    i must detect the fiscal year (year, quarter...) in the configuration of dynamics crm. 


    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

    • Marked as answer by Ammar.Zaied Wednesday, April 8, 2015 4:36 PM
    Wednesday, April 8, 2015 4:36 PM