MS CRM Portal – Get currency from CRM using Odata and bind on the portal form

                var selectedCurrencyId = $(“#transactioncurrencyid”).val();

                if (selectedCurrencyId != “”) {

                    var getCurrencyDetails = “https://mycrm.microsoftcrmportals.com/_odata/Currency?$filter=transactioncurrencyid eq guid’” + selectedCurrencyId + “‘”;

                    var oDataResponse = getODataResponse(getCurrencyDetails);

                    if (oDataResponse != null) {

                        if (oDataResponse[0].isocurrencycode != null) {

                            var amount_label = $(‘#new_amount_label’).text();

                            $(‘#new_amount_label’).text(“Amount ” + “(” + oDataResponse[0].isocurrencycode + “)”);

                        }

                        else {

                            $(‘#amount_label’).text(“Amount “);

                        }

                    }

                }

                else {

                    $(‘#amount_label’).text(“Amount “);

                }

Leave a comment