Shahed Shah1
Tera Guru

Last week I introduced how to use a multiple currency model in your instance. We learned that fields of type Price extends the behaviour of the Currency field type. We took note that the Service Catalog utilizes the Price field, so the idea of localizing prices is different from how currencies work. We identified the two models which how currencies are handled and we looked at Multi Currency, specifically. Finally, we learned that in the Multi Currency Model, the currency symbol and values are stored in the Currency Instances (fx_currency_instance)>table.

 

With that summary, you are probably left with some lingering questions, but please bear with me as we are nearly there. In this blog we will look at the next model, which is Single Currency.

 

Using the Single Currency Model

The difference with this model is immediately apparent in the UI. When using this model the currency symbol drop-down is removed from the Currency field and you are presented with a single currency symbol. There is no way for you to select the type of currency being used.

single_currency_no_selector.jpg

The logic for this comes from the glide.i18n.single_currency.code property where it is used to display the currency symbol (this is important to note).

 

This is because the property is only setting what is in the display and it doesn't tell the platform what currency to work with. Wait, what? Yes, these two properties need to work together to get things working nicely. Let's repeat it again in another way:

  • glide.system.locale is telling the platform what currency to use.
  • glide.i18n.single_currency.code is telling the platform what currency to display on items in the catalog.

 

For example, let's say we have the following configuration:

  • glide.system.locale = (empty)
  • glide.i18n.single_currency.code = AUD

 

The problem with this is that the users will just see $ in the display thinking that they are putting in Australian Dollars. If no locale is specified, the platform is being told that the users are providing values in US Dollars by default. Ahhh, now you see the problem. This is where things go wrong. If you want your Instance to be Australian through and through (can you believe this blog is written by a British guy, eh?), you must include the currency it should be set to.

 

For this example it should look like this:

  • glide.system.locale = en.AU
  • glide.i18n.single_currency.code = AUD

 

So, the takeout here is that the Instance locale (glide.system.locale) and the Single Currency Display (glide.i18n.single_currency.code) should match.

 

Can We Delete the fx_currency_instance Records?

Finally! How long have you been waiting to ask this? And, guess what? Gotcha! Now you should see why the answer is not so straightforward. When deleted, the records are still recreated using the originating (or referenced, if you like) record's value for the respective Currency field(s).

 

Doing this while using the Single Currency Model (if configured correctly) is not an issue since there is only one currency set for the Instance. Doing this while using the Multi Currency Model, is an issue. This is because we will lose the actual currency symbol that the user selected from the drop-down. If you do this, the record will get recreated with the value stored in the Currency field, but the actual currency symbol will come from the glide.system.locale property.

 

As an example, if I have a currency value of £300.50 and the Instance locale is empty (so defaulting to en.US, meaning dollars for the base currency), the regenerated Currency Instance record will be $300.50 - now all your calculations and list summaries will go out of whack - similar to the situation presented in the above section.

 

How do I Switch to the Single Currency Model?

For shame. After all this you ask "how?" The first question should be "when?". The answer: from the start. Before you go creating Catalog Items, before you go creating records with currency values you should switch to the single currency model; otherwise, you will end up in the situation mentioned before a few years down the line, not realizing the mess in the currency values being there for a while. This would require a big big clean up in order to fix.

 

This whole thing boils down to one small, innocent looking, property:

single currency model property.jpg

(Property name: glide.i18n.single_currency)

 

Just check the property, save, and Presto!

 

Considering all that has been covered, moving to the Single Currency Model is not straight forward, as you will have to ensure all the currencies and values have been normalized into one common currency (and values). You can write various scripts to take the Reference amount and Reference currency, then push it to the Currency field of that originating record, or even the other way round, or both. But, the truth is, is that you still need to manually intervene to ensure the correct currency and value is being "restored" or "copied".

 

Once you have done all this you can then proceed with the following:

  1. Set the glide.system.locale property to the target currency.
  2. Set the glide.i18n.single_currency.code property to the target currency.
  3. Set the glide.i18n.single_currency property to true.
1 Comment