In the example, the invoke method must return a JSON map that signals the framework to update its object lists in the client. The map must contain a
result key whose value is the result of the service call. A utility class
ActionResult is provided to define additional result parameters.
If the action adds, updates, or deletes objects, you should use an instance of ActionResult to notify the Web Client framework, so it can update object lists in the client. Use the
ActionResult methods
setObjectAddedResult,
setObjectChangedResult, or
setObjectDeletedResult. Pass the result returned by the service as the first parameter to the method.
The ActionResult methods accept an optional second parameter that contains a message key that the client code can use to report an error in the UI if the result is false or null. Alternatively, you can use the
setErrorMessage method to add the error message key to the results map.