Meet Long Integer, the New OutSystems Data Type

Meet Long Integer, the New OutSystems Data Type

  
Hello,

Starting with OutSystems Platform 9 Bali, we are introducing a new data type: Long Integer.


Why?

Because we want to support enterprise-grade applications with a large amount of records (more than 2.000.000.000). Besides, we wanted to ease integration with external systems that contain large identifiers.


What is the Long Integer type?

The Long Integer type is a 64-bit integer without decimal digits that you can use as any other numeric data type in OutSystems.




With this new data type, we have also added new built-in functions to allow you to convert the existing data types to Long Integer:
 


From

To

Function Name

Notes

Decimal

Long Integer

DecimalToLongInteger(Decimal)

Converts a Decimal to a Long Integer value. Returns 0 if the conversion is not possible. You can use DecimalToLongIntegerValidate(Decimal) to validate the conversion.

Text

Long Integer

TextToLongInteger(Text)

Converts a Text to a Long Integer value. Returns 0 if the conversion is not possible. You can use TextToLongIntegerValidate(Text) to validate the conversion.


Also, you should be able to convert a Long Integer to the types that you are already familiar with:



From

To

Function Name

Notes

Long Integer

Text

LongIntegerToText(Long Integer)

Converts a Long Integer value to a Text value.

Long Integer

Integer

LongIntegerToInteger(Long Integer)

Converts a Long Integer to an Integer value. Returns 0 if the conversion is not possible. You can use LongIntegerToIntegerValidate(Long Integer) to validate the conversion.


Entity Reference is now called Identifier

We also renamed some of the existing built-in functions to simplify the learning path for new OutSystems developers:

 

Old names

New names

TextToEntityRefText(Text)

TextToIdentifier(Text)

IntegerToEntityRefInteger(Integer)

IntegerToIdentifier(Integer)

EntityRefIntegerToInteger(Integer Identifier)

IdentifierToInteger(Integer Identifier)

EntityRefTextToText(Text Identifier)

IdentifierToText(Text Identifier)


Why? Because these names are shorter and clearer than the old ones. Furthermore, we didn’t want to introduce new built-in functions when the naming convention could clearly be improved in the old ones!

     



Long Integer is the new default data type for entity identifiers

Not only Long Integer is a new identifier data type but it is also the new default data type for entity identifiers! Why? Your entities may grow more than you expected at the beginning of the development. By setting entity identifiers as Long Integers from the beginning, it will avoid doing complex data migrations afterwards (read more about this topic here).

We have some extra built-in functions related with Long Integer entity identifiers:


It is worth to mention that the well-known NullIdentifier() is also valid for Long Integer identifiers.

What will be the impact in my apps?

Long integers will have a minimal impact on the Platform upgrade. As the new  default identifier data type, Long Integer will only be applied to new entities. That is, we will not change existing entities with identifiers with Integer data type. However, if you want to upgrade the existing entities to use Long Integer Identifiers, check this topic.

We have also changed Aggregate Count and Sum functions and the Count aggregate property (counts the total number of records) to accommodate the new Long Integer data type. Due to these changes you should expect new warnings and errors on rare occasions. Now, the Count function always returns a Long Integer instead of Integer (the old default data type). The Sum function returns Long Integer for Integer and Long Integer attributes (the behavior for the other data types is the same as in previous versions of the Platform).







RichWidgets supports lists with a larger amount of records

We also updated RichWidgets pagination widgets to work with Long Integers instead of Integers. Why? Because the pagination widget reflects the number of rows in a list and this value typically comes from the Count aggregate property, that returns a Long Integer. To start using the Long Integer data type in the RichWidgets pagination widget, simply republish your application modules.

All warnings and errors will be detected at development time. They can be solved with simple variable and attribute data type changes as described in  validation messages.



For more information please check our online help here.

The following two methods have also been added
  • LongIntegerToIdentifier
  • IdentifierToLongIdentifier
The purpose of these functions is obvious.