locked
Get FormattedValue Attribute RRS feed

  • Question

  • hi,

    how to get the value of formattedValue (i use fetchxml and JS), the request:>

    <fetch distinct="false" mapping="logical" aggregate="true" output-format="xml-platform" >
        <entity name="opportunity" >
            <attribute name="actualvalue" alias="value" aggregate="sum" />
            <filter type="and" >
                <condition attribute="createdbyname" operator="eq" value="Administrateur Cynapsys" />
            </filter>
            <filter type="and" >
                <condition attribute="actualclosedate" operator="in-fiscal-period" value="4" />
            </filter>
        </entity>
    </fetch>

     

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

    Tuesday, April 7, 2015 8:48 AM

Answers

  • The solution:>

    var Req_Q2 = XrmServiceToolkit.Soap.Fetch(Request_GetWonOpportunityBySalesAndQuarter(Sales, 2));
                    try
                    {
                        var Q2 = Req_Q2[indexSales].attributes.opportunity_sum.value;
                        if (Q2 == null)
                        { Q2 = 0; }
                        else { var Q2 = Req_Q2[indexSales].attributes.opportunity_sum.formattedValue; }
                    }
                    catch (error)
                    {
                        console.log(error);
                    }
                    console.log("Value of Q2 : ",Q2);

    it is possible in javascript.


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

    • Marked as answer by Ammar.Zaied Tuesday, April 7, 2015 9:46 AM
    Tuesday, April 7, 2015 9:46 AM