locked
Getting message unsaved changes after clicking save/save & close in Opportunity RRS feed

  • Question

  • Hi,

    We have a custom Javascript in Opportunity customerid onchange event. It automatically assign opportunity transaction currency with the currency selected on account. If we comment out below code opportunity form saves without any message. However, if we enabled below code it shows unsaved changes exist do you want to navigate away message twice. Any clues with this problem?

                    if (retrievedAccount.TransactionCurrencyId.Id != null) {
                        if (Xrm.Page.data.entity.attributes.get("transactioncurrencyid").getValue() != retrievedAccount.TransactionCurrencyId.Id) {
                            Xrm.Page.data.entity.attributes.get("transactioncurrencyid").setValue(
                                [{
                                    id: retrievedAccount.TransactionCurrencyId.Id,
                                    name: retrievedAccount.TransactionCurrencyId.Name,
                                    entityType: "transactioncurrency"
                                }]
                            );
                            //Xrm.Page.getAttribute("transactioncurrencyid").fireOnChange();
                        }
                    }
    

    Thanks

    Ajai

    Wednesday, September 30, 2015 5:30 AM

All replies