Validating client-side coaches using server-side validation
You can validate coaches in client-side human services using server-side validation.
About this task
In server-side validation for coaches in client-side human services, the human service flow calls a service on the server to do the validation. The client-side human service then handles any messages that are returned by the server.
Use server-side validation
to validate data in a coach in a client-side human service when the
following situations apply:
- The validation must access private or confidential data that should not be made available to the client. Server-side validation is the more secure approach.
- The validation must access server-based data or large amounts of data to do the validation. For example, you have Order coach in which users can order parts and you want to validate that a part is in stock. It is not practical to use client-side validation in this situation. Loading large amounts of data impacts the performance of the client.
- You are migrating heritage human services to client-side human services and you want to reuse some or all of the validation scripts you had in the heritage human service. The client-side human services call the validation service that you previously used. However, examine the script logic to move appropriate validation code to the client to minimize server calls.
The following procedure
uses a help desk client-side human service as an example. The human
service consists of several fields and a Create Ticket button.
Tip: Where possible, combine your server-side validation with
server-side logic that does work as shown in the examples in this
procedure. That is, a single server-side service validates the ticket
and also saves it. While you could do this in separate steps in the
human service, combining them in this way provides better performance.
It also places related logic together to produce more maintainable
models.
Procedure
To validate a coach by using server-side validation: