Recently Microsoft have released quite a few updates to it’s client API and one such is the update to API for getting the currency name of the logged in user.
All this time, Microsoft had an API to get the transaction currency id of the logged in user using the API – Xrm.Utility.getGlobalContext().userSettings.transactionCurrencyId. You needed to run a separate query to fetch the currency name based on currency id. However it is being deprecated now and now the replacement API is Xrm.Utility.getGlobalContext().userSettings.transactionCurrency.
This wonderful api returns the name of the currency as well as the id and entityType.
Below is the sample output
{id: “e7dd9bc6-d239-ea11-a813-000d3a35b14a”, entityType: “transactioncurrency”, name: “US Dollar”}
Wonderful isn’t it?
Hope this helps!
Debajit Dutta
(Dynamics MVP)
For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com
Our product offerings:
Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)
CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)
Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.