What is the best way to create constant in outsystems?

Is there anyway other than site properties? Constants defined thru site properties can be used at offline?

Is there any way to define the constants at screen level?

Please help.


Hello Arunkumar Balu,

You cannot use site property at offline.

You can create a client action and set the default value to variable.

Solution

Like Suhas suggested, when I need a constant value, I usually create a function with a nice description, such as Constant_BusinessName, that returns the constant value. I then proceed to use that function whenever I need the constant.

I prefer the above approach but, if your constant are an enumeration os something, you can also use a Static Entity.

Solution

João Pedro Abreu wrote:

Like Suhas suggested, when I need a constant value, I usually create a function with a nice description, such as Constant_BusinessName, that returns the constant value. I then proceed to use that function whenever I need the constant.

I prefer the above approach but, if your constant are an enumeration os something, you can also use a Static Entity.

You cannot use the static entity at offline.


Suhas Jamdade wrote:

João Pedro Abreu wrote:

Like Suhas suggested, when I need a constant value, I usually create a function with a nice description, such as Constant_BusinessName, that returns the constant value. I then proceed to use that function whenever I need the constant.

I prefer the above approach but, if your constant are an enumeration os something, you can also use a Static Entity.

You cannot use the static entity at offline.


Suhas thanks for your valuable info