CurrencyIsoCode display on layout issue in Lightning experience on Millau (11.2.2)

  • 3
  • Problem
  • Updated 3 months ago
  • Acknowledged
My org setup Multi-Currency enabled and the JPY is org's corporate currency.

The issue is all records (currency data type) with CurrencyIsoCode is VND or USD, I expect they will display with VND (e.g. VND 1,907,000.00) but it displays ¥1,907,000.00 instead.

This issue only occurs in Lightning experience (not in classic mode).

Please help to check quickly.

Thanks.

Photo of Kevin

Kevin

  • 572 Points 500 badge 2x thumb

Posted 5 months ago

  • 3
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Have you updated your out of date themes?
Photo of Kevin

Kevin

  • 572 Points 500 badge 2x thumb
Hi Stephen,
I always do it whenever upgrading to new version.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Have you always had this problem or is it new behavior?
Photo of Kevin

Kevin

  • 572 Points 500 badge 2x thumb
It occurs in recent version, maybe 11.2.1
Photo of Jayesh Bhatnagar

Jayesh Bhatnagar

  • 476 Points 250 badge 2x thumb
We have this issue as well and we are on 11.1.18. 
Photo of Jayesh Bhatnagar

Jayesh Bhatnagar

  • 476 Points 250 badge 2x thumb
Any update on this bug?
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Kevin and Jayesh,

We've been able to reproduce this issue in Lightning. To be specific, it looks like currencies that aren't the corporate currency are being given the corporate currency symbol in Lightning. We will submit this as a product issue to our engineering team, and update this conversation when a fix is available.

We have also found a workaround for you to try, in the mean time. First, you'd put your affected Skuid page inside a Visualforce page. Then, you can bring that Visualforce page into your Lightning App Builder page (using Salesforce's "Visualforce" Lightning component). This lets your Skuid page run in Lightning, but it runs as though it's in the Classic runtime, which brings in the correct currency codes. Please let me know if you have any questions about this. 
(Edited)
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
Hi Mark, all our pages are deployed via Skuid page component or a Lightning component, so we are not planning to go back to VF.  Our pages have calls to update components, and it would just be a step backwards to regress to VF.

Do you have an ETA on the fix?  This is clearly a big issue when it comes to multi currency enabled orgs.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Chandra. We do not yet have any ETA on a fix yet, but our engineers are aware. I understand the level of urgency and have shared it with our product team. I hear you that using VisualForce is not a viable workaround in some cases, and if another option is found, we will definitely share on this thread. 
Photo of Jacob Cohen

Jacob Cohen, Employee

  • 142 Points 100 badge 2x thumb
Hi Chandra, I have a work around to try for the currency issue in Lightning. It is a custom renderer to correct the currency symbol being shown in the amount field to the row level currency. I put it at the bottom of this message.
The main thing to be aware of when using this is the currency symbols will have to be added to the render's mapping feature manually for them to be available.
The mapping is optional to its functionality though, and the currency's ISO code can be shown easily from the available data.
To use this make sure the CurrencyIsoCode field is in the opportunity model, and render the Amount field with it.

There are a few declarative alternatives here as well. If the metadata for the amount field is changed to Number at the model level in the composer the default field won't show any symbol at all. With a Template field to bring in the ISO this will give you essentially the same results as the snippet without the symbol. ( ex: {{CurrencyIsoCode}} {{Amount}} ) To go a step further declaratively, it should be possible to conduct the same symbol mapping in a UI only field that I have in the snippet. Using something like that a full declarative work around could be possible here.

Let me know how this works out and if you have any questions or issues.

var field = arguments[0],
    value = arguments[1],
    displayType = field.metadata.displaytype,
    model = field.model,
    mode = field.mode,
	$ = skuid.$;


/**currency symbol map to build on if you don't want to use the ISO**/
/**optional**/
var currencyMap = [
        {
            iso: 'USD',
            symbol: '$'
        },
        {
            iso: 'EUR',
            symbol: '€'
        }
    ];

/**find the actual currency of the row**/
var realCur = field.row.CurrencyIsoCode,
    curSym;

/**loop through the currency map to find your symbol**/
/**optional**/
$.each(currencyMap,function(){
    if(this.iso.toLowerCase() === realCur.toLowerCase()){
        curSym = this.symbol;
    }
});

/**the currency symbol is not necessary for this. the curSym variable can be replaced with realCur to show the ISO instead**/
    value = curSym + ' ' + value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");

/**display the field as text**/
skuid.ui.getFieldRenderer('TEXT', model.getDataSource())[mode](field, value);
Photo of Kevin

Kevin

  • 572 Points 500 badge 2x thumb
Hi Mark,

Could your team fix this issue in next release?