locked
Currency symol doesn't change after transactioncurrency change RRS feed

  • Question

  • I use JS to change currency in transactioncurrencyid field on product form.

    But after the change is done, currency symbol in money fields doesn't change.

    If I change currency manually the symbol changes so there is probably some system js function that changes the symbol on transactincurrencyid change.

    Do you know anything about this?
    Thursday, January 8, 2009 8:37 AM

Answers

  • I actually found other way.
    I used IE developer toolbar to check what is done when transaction currency is changed. And the is some JS code run on change of the field. I used it to create function updating currency symbol on the form:

    function UpdateCurrencySymbolInUI(currencysymbol)
    {
            if(!IsNull(crmForm))
            {
                    var iLen = crmForm.all.length;
                    var oCtrl,i;

                    for (i = 0; i < iLen; i++)
                    {
                            oCtrl = crmForm.allIdea;
                            if(!IsNull(oCtrl.IsMoney) && !oCtrl.IsBaseCurrency)
                            {
                                    oCtrl.CurrencySymbol = currencysymbol;
                            }
                    }
            }

    }

    Just run it on currency change and all the currency sumbols ale updated.
    Friday, January 9, 2009 8:38 AM

All replies

  • You will need to refresh your form (in the javascript) for the currency symbol to change. Unfortunately that is the only way to update html elements.

    Hassan.

    Thursday, January 8, 2009 3:22 PM
  • I actually found other way.
    I used IE developer toolbar to check what is done when transaction currency is changed. And the is some JS code run on change of the field. I used it to create function updating currency symbol on the form:

    function UpdateCurrencySymbolInUI(currencysymbol)
    {
            if(!IsNull(crmForm))
            {
                    var iLen = crmForm.all.length;
                    var oCtrl,i;

                    for (i = 0; i < iLen; i++)
                    {
                            oCtrl = crmForm.allIdea;
                            if(!IsNull(oCtrl.IsMoney) && !oCtrl.IsBaseCurrency)
                            {
                                    oCtrl.CurrencySymbol = currencysymbol;
                            }
                    }
            }

    }

    Just run it on currency change and all the currency sumbols ale updated.
    Friday, January 9, 2009 8:38 AM