locked
how to convert string into currency in CRM 2013 RRS feed

  • Question

  • Hi,

    I have two fields "new_days" its data type is Text and "new_cost" its data type is Currency. I want to perform calculation and save into another fiel. I am doing like this:

    var days=Xrm.Page.getAttribute("new_days").getValue();
    var cost=Xrm.Page.getAttribute("new_cost").getValue();

    var Totalcost=cost*days;

    Xrm.Page.getAttribute("new_Total").getValue(Totalcost);

    Please guide me how to convert string values into currency.

    Thursday, July 24, 2014 6:59 AM

All replies

  • Hi,

    If the code that you wrote above doesn't work, try with this:

    var days=Xrm.Page.getAttribute("new_days").getValue();
     var cost=Xrm.Page.getAttribute("new_cost").getValue();
    
    var Totalcost=cost*days;
    
    Xrm.Page.getAttribute("new_Total").setValue(parseFloat(eval(Totalcost)));
    


    Admin QuikView Solution for CRM 2013

    Friday, July 25, 2014 7:23 AM