There are two things to do.
For example, there is the following entity.
Micropost entity has three attributes.Id attribute is identifier of this entity.Content attribute has text that length is less than or equal to 140.UserId attribute has ServiceCenter/User.Id.All three attributes are mandatory.
Micropost
Id
Content
UserId
ServiceCenter/User.Id
I want to verify two things below.
Now let's get started.
Open the validation rules page in this app (https://<YOUR_SERVER>/ValidationHelper/).The page of Micropost is as follows.You will see the attributes in Micropost and you will see links to add validation.
Set the validation rules.
Open the screen I want to verify in Service Studio.(The screen below was created by scaffolding.)
Open the action you want to validate. This time I will verify in the "Save" button.Then call the validation action of "VH_IsValidEntity".In the input parameter "EntityObject" of this action, specify the variable of the entity converted by "ToObject".
That's all for how to use it.Let's check the execution result
Open the details screen of "Micropost" and enter 141 characters in "Content". Nothing is specified for "UserId".
When I clicked the "Save" button, verification was performed and an error occurred.
Now empty Content and click Save. It has been verified as expected.