16
Views
5
Comments
Can we customize scaffolding of FormatCurrency function call for currency attribute?
Application Type
Traditional Web
Service Studio Version
11.10.0 (Build 34711)

When dragging a database entity onto the screen, OutSystems scaffolding for List Records treat currency type attributes very nicely by generating a value that uses built-in function FormatCurrency like the following: 

FormatCurrency(MyEntityTable.List.Current.MyEntity.Amount, Site.Currency, 2, Site.DecimalSeparator, Site.GroupSeparator)

However, this is dependent on the fact that we have these 3 site properties Currency, DecimalSeparator, GroupSeparator.

I have a multi-tenant application, I could simply set these site properties to be multi-tenant (set Is multi-tenant property to yes) which allows me to set separate values of these properties for each of my tenants. 

But my problem becomes more complicated when I have several modules in which I would need to add these 3 site properties for the scaffolding to work consistent across modules, but managing the tenant-based site property values for all of the modules does not seem easily manageable. 

Is there a way to customize the OutSystems scaffolding rules/behaviors?

I could maybe decide to use site property from a common module by exposing the property value via public server action?

What is the recommended approach or OutSystems guideline to deal with this situation, or maybe anyone from the community could share their approach to solve a similar problem?

mvp_badge
MVP
Rank: #17

Hi Emad,

It is currently not possible to customize the OutSystems scaffolding rules/behaviors.

On outsystems.com/ideas there are multiple ideas that request this that you vote on.

Regards,

Daniel

mvp_badge
MVP
Rank: #17

What normally is done is write your own wrapper function around FormatCurrency , and replace all calls to  FormatCurrency  with your function.

Rank: #6754

Thank you Daniël for your valuable responses.

So the most viable option I could see at this point is that I set the Is Multi-tenant attribute to yes for the 3 site properties Currency, DecimalSeparator, GroupSeparator

Since my app is currently live in production, are there any migration concerns I should be worried about when pushing my changes to the prod environment? 

I believe it should be simple as OutSystems creating separate properties for each tenant with a default value defined for each, right?