Actions
Server Actions¶
 IsValidEntity¶
 IsValidEntity¶
Validate entity based on Validation Rules.
Parameters¶
 Object Object- EntityObject(Mandatory)
- Specify the Entity object to be validated. To specify an Entity object, use the ToObjectfunction. Example:ToObject(GetFooById.List.Current.Foo)
 Boolean Boolean- IsOccurException(Mandatory)
- If True, an exception is raised if the validation does not pass.
 Structure Structure- ErrorFormat
- Format of the error message if IsOccurExceptionis 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 Boolean- IsValid
- True if validation is passed.
 List 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¶
 HasError¶
Returns the error message for the specified attribute in ErrorList (IsValidEntity Action's output).
Parameters¶
 Structure Structure- ErrorList (AttrName, Message)(Mandatory)
- IsValidEntityAction's output.
 Structure Structure- AttrName(Mandatory)
- Attribute name to be retrieved from ErrorList. Ignore case.
 Structure Structure- Out (IsValid, Message)
- IsValidis False if- AttrNameis in- ErrorList.
Client Actions¶
 IsValidEntity¶
 IsValidEntity¶
Validate entity based on Validation Rules.
Parameters¶
 Object Object- EntityObject(Mandatory)
- See IsValidEntityin Server Action
 Boolean Boolean- IsOccurException(Mandatory)
- See IsValidEntityin Server Action
 Structure Structure- ErrorFormat
- See IsValidEntityin Server Action
 Integer 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 Boolean- IsValid
- See IsValidEntityin Server Action
 List List- ErrorList (AttrName, Message)
- See IsValidEntityin Server Action
 HasError¶
 HasError¶
Returns the error message for the specified attribute in ErrorList (IsValidEntity Action's output).
Parameters¶
 Structure Structure- ErrorList (AttrName, Message)(Mandatory)
- See HasErrorin Server Action
 Text 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 NameOfaction.
 Structure Structure- Out (IsValid, Message)
- See HasErrorin Server Action
 NameOf¶
 NameOf¶
Get the name of the object. Note: This action is experimental
Parameters¶
 Object 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 Text- Name
- Object Name
 Message¶
 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
 Text message (Mandatory)
 Text
 Text messageType (Mandatory)
 Text
 Text encodeHTML (Mandatory)
 Text
 Text extraCssClasses (Mandatory)
 Text
 Text closeOnClick (Mandatory)
 Text
 Text onClick (Mandatory)
 Message_Error¶
 Message_Error¶
Shortcut for error messages.
Parameters¶
 Text
 Text message (Mandatory)
 Text
 Text encodeHTML (Mandatory)
 Text
 Text extraCssClasses (Mandatory)
 Text
 Text closeOnClick (Mandatory)
 Text
 Text onClick (Mandatory)
 Message_Info¶
 Message_Info¶
Shortcut for info messages.
Parameters¶
 Text
 Text message (Mandatory)
 Text
 Text encodeHTML (Mandatory)
 Text
 Text extraCssClasses (Mandatory)
 Text
 Text closeOnClick (Mandatory)
 Text
 Text onClick (Mandatory)
 Message_Success¶
 Message_Success¶
Shortcut for success messages.
Parameters¶
 Text
 Text message (Mandatory)
 Text
 Text encodeHTML (Mandatory)
 Text
 Text extraCssClasses (Mandatory)
 Text
 Text closeOnClick (Mandatory)
 Text
 Text onClick (Mandatory)
 Message_Warning¶
 Message_Warning¶
Shortcut for warning messages.
Parameters¶
 Text
 Text message (Mandatory)
 Text
 Text encodeHTML (Mandatory)
 Text
 Text extraCssClasses (Mandatory)
 Text
 Text closeOnClick (Mandatory)
 Text
 Text onClick (Mandatory)