locked
how to calculate total using SDK.REST retrive multiple RRS feed

  • Question

  • Hi,

    I'm trying to create total but i could not able to get the value.

    CRM Version : 2015 online update 1

    function GetTotalAmtPlan()
    {
    var TotalPlan = 0;
    var TotalPlanGP = 0;

    SDK.REST.retrieveMultipleRecords(
        "SalesOrder",
        "select**************************",
        function (results) {
        for (var i = 0; i < results.length; i++) {
             var orderNumber = results[i].OrderNumber;
             for (var a = 0; a < results[i].order_details.results.length; a++) {
                  var order_details_oc_PlanAmount = results[i].order_details.results[a].oc_PlanAmount;
                  var order_details_oc_PlanGP = results[i].order_details.results[a].oc_PlanGP;
                  alert(results[i].order_details.results[a].oc_PlanAmount.Value());
         //TotalPlan = TotalPlan + order_details_oc_PlanAmount;
         //TotalPlanGP = TotalPlanGP + Number(order_details_oc_PlanGP.Value);
             }
        }
        },
        function (error) {
             alert(error.message);
        },
        function () {
             //On Complete - Do Something
        }
    );
    alert(TotalPlan);
    alert(TotalPlanGP);
    }

    hope you can help me.


    Zosimo D. Recio Jr. Microsoft Certified (Business Management Solutions specialist)

    Wednesday, February 24, 2016 2:56 AM

All replies