Skip to content

Actions

Server Actions

IsValidEntity

Validate entity based on Validation Rules.

Parameters

Object EntityObject (Mandatory)
Specify the Entity object to be validated. To specify an Entity object, use the ToObject function. Example: ToObject(GetFooById.List.Current.Foo)
Boolean IsOccurException (Mandatory)
If True, an exception is raised if the validation does not pass.
Structure ErrorFormat
Format of the error message if IsOccurException is True and the validation did not pass.

Text Prefix

- Prefix to be given to error messages if they do not pass validation.
- Default Value: `"${ErrorCount} Validation Error(s).<ul>"`
- Avalidable Placeholders:
  - `${ErrorCount}`: Number of total errors.

Text Detail

- If the validation does not pass, the format of the error message details.
- Default Value: `"<li>${ErrorMessage}</li>"`
- Avalidable Placeholders:
  - `${ErrorMessage}`
    - Details for one validation error.
    - ex) "FooBar is too short (minimum is 10 characters)"
  - `${AttrName}`
    - Name of the attribute that caused the validation error
    - ex) "FirstName"

Text DetailSeparator

- Separator for each error detail.
- Default Value: `""`

Text Suffix

- Suffix error messages.
- Default Value: `"</ul>"`
Boolean IsValid
True if validation is passed.
List ErrorList (AttrName, Message)
If the validation did not pass, a list of details of the error. With an error message for each attribute.

HasError

Returns the error message for the specified attribute in ErrorList (IsValidEntity Action's output).

Parameters

Structure ErrorList (AttrName, Message) (Mandatory)
IsValidEntity Action's output.
Structure AttrName (Mandatory)
Attribute name to be retrieved from ErrorList. Ignore case.
Structure Out (IsValid, Message)
IsValid is False if AttrName is in ErrorList.

Client Actions

IsValidEntity

Validate entity based on Validation Rules.

Parameters

Object EntityObject (Mandatory)
See IsValidEntity in Server Action
Boolean IsOccurException (Mandatory)
See IsValidEntity in Server Action
Structure ErrorFormat
See IsValidEntity in Server Action
Integer CacheInMinutes
Time to cache the validation rules. If the cache becomes invalid, the validation rule is re-fetched from the server.
  • Default Value: 1440
Boolean IsValid
See IsValidEntity in Server Action
List ErrorList (AttrName, Message)
See IsValidEntity in Server Action

HasError

Returns the error message for the specified attribute in ErrorList (IsValidEntity Action's output).

Parameters

Structure ErrorList (AttrName, Message) (Mandatory)
See HasError in Server Action
Text AttrName (Mandatory)
Attribute name to be retrieved from ErrorList. Ignore case. If you do not want to hardcode attribute names, you can use the NameOf action.
Structure Out (IsValid, Message)
See HasError in Server Action

NameOf

Get the name of the object. Note: This action is experimental

Parameters

Object Object (Mandatory)
Specify the object for which you want to get a name.
Examples:
ToObject(GetFooById.List.Current.Foo.Bar)
# Output = bar

ToObject(GetFooById.List.Current.Foo)
# Output = foo

ToObject(GetFooById.List.Current)
# Output = Current

ToObject(GetFooById.List[1])
# Output = List[1]

ToObject(Foo.Bar)
# Output = bar

ToObject(Foo)
# Output = foo
Text Name
Object Name

Message

Wrapper for FeedbackMessage API in OutSystems' standard JavaScript API. The error message returned by default by the IsValidEntity action contains HTML <br> and <ul> tags, but you must use this Message action with the input parameter encodeHTML set to False in order to correctly display this error message in your feedback message.

Parameters

Text message (Mandatory) Text messageType (Mandatory) Text encodeHTML (Mandatory) Text extraCssClasses (Mandatory) Text closeOnClick (Mandatory) Text onClick (Mandatory)

Message_Error

Shortcut for error messages.

Parameters

Text message (Mandatory) Text encodeHTML (Mandatory) Text extraCssClasses (Mandatory) Text closeOnClick (Mandatory) Text onClick (Mandatory)

Message_Info

Shortcut for info messages.

Parameters

Text message (Mandatory) Text encodeHTML (Mandatory) Text extraCssClasses (Mandatory) Text closeOnClick (Mandatory) Text onClick (Mandatory)

Message_Success

Shortcut for success messages.

Parameters

Text message (Mandatory) Text encodeHTML (Mandatory) Text extraCssClasses (Mandatory) Text closeOnClick (Mandatory) Text onClick (Mandatory)

Message_Warning

Shortcut for warning messages.

Parameters

Text message (Mandatory) Text encodeHTML (Mandatory) Text extraCssClasses (Mandatory) Text closeOnClick (Mandatory) Text onClick (Mandatory)