Interface Formatter
The interface formatter is available on object and method fields. The interface formatter settings from the method fields are inherited from the object fields. This article explains what an interface formatter does and how it can be configured.
Input and Output Settings
The framework works with .NET types. Numeric values could be represented by Decimal, Double or Integer objects, date values are represented by DateTime objects, yes no values are converted to Boolean objects, and so on. This gives us great flexbility in terms of performance, displaying information, filtering information, checking information and so on. This is why you should use the available field types. But converting to a correct .NET type does not go always automatically.
Some interfaces like the SAP interface or ODBC interface (only if the ODBC Driver support this (!)) are capable of automatically converting data to the correct .NET type and do not need to be converted manually. However, some interfaces cannot convert data automatically and rely on the input and output interface formatter for converting the data to the correct .NET object.
Input interface formatter is used when the input field is used in the interface script or when the interface does not support casting to the .NET type. When the Ometa Framework sends the value to the external system, it uses the input interface formatter to sent it as a string field.
Let’s explain this with a small example. Our external system has a date field. The external system expects that date fields must be in the format yyyy-MM-dd. When a date value comes to our framework, date fields are always represented by a date time .NET object. When the framework sends the value to the external system we convert the date time .NET object to a string. The second of July 2016 will be changed to 2016-07-02. But again, this will only happen if the interface does not support .NET types like the BaaN interface or some ODBC drivers and if the input field is not used in the interface script.
Output interface formatter is used when the data of the external system reaches our framework. If the interface does not support type casting, the framework looks to the output interface formatter. The framework must know the format of the external system in order to successfully cast the string to the correct .NET object. Most of the time, the interface and output interface formatters will share the same settings.
The figure above also shows the View formatter. The view formatter can be configured on view level and only concerns presentation. In other words, how should the date or numeric values be presented to the user. Should the user see 2016-07-02 or 02/07/2016? View formatters do have the same settings but serve a totally different purpose.
Let’s explain the different options of the interface formatter in the next chapters.
Use Current UI Culture
On SharePoint, this option will use the users SharePoint culture settings. If it's outside of sharepoint, this option will use the current browser settings.
Base Culture
The base culture dropdown list contains a long list of all the available .NET cultures. Each culture contains a definition of how a number and date are formatted, which currency sign is used, …
Override Base Culture
The override base culture checkbox allows you to derive from the base culture. Depending on the field type (date time, number, integer or currency), different properties are available. However, we advise not to override the base culture.
Interface Formatter Specific Properties
Depending on the field type, there are different culture properties.
Group Separator
Applies to: integer, number, currency
The group separator a.k.a. thousands separator is the separator used to separate digets. The United Kingdom and the United States use a comma to separate groups of thousands. Many other countries use a period instead, and some countries separate thousands groups with a white space.
A million in the United Kingdom will be displayed in the ADM as 1,000,000.
Also note that the Group Separator can only be 1 character.
Decimal Separator
Applies to: number, currency
According to Wikipedia, the decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form.
Also note that the Decimal Separator can only be 1 character.
Negative Pattern
Applies to: integer, number, currency
The negative pattern defines how a negative numeric value looks. When the setting is configured like n- the negative sign will be placed after the number. Just replace the n by the number to know how it will be formatted.
Currency Symbol
Applies to: currency
The currency symbol is used to show the symbol before or after the numeric value in the ADM. Changing the currency symbol to a piece of text like DOLLARS could lead in unexpected behaviour. For this reason we advice not to change the currency symbol.
Also note that the Currency Separator can only be 1 character.
Date Pattern
Applies to: date and time
The date pattern defines how a date should be formatted in the ADM. It must be a valid .NET pattern. Refer to the following MSDN article to find out more about valid date and time patterns: Custom date and time format strings
DateTime Separator
Applies to: date and time
The date time separator is used to separate the date part from the time part. Mostly a white space is used.
Also note that the DateTime Separator can only be 1 character.
Time Pattern
Applies to: date and time
The time pattern defines how a time should be formatted in the ADM. It must be a valid .NET pattern. Refer to the following MSDN article to find out more about valid date and time patterns: Custom date and time format strings