For a few weeks, you’ve been able to use the offline action feature, and we’ve already obtained great feedback about it.
As we’re constantly improving the product’s features set, application users can edit and retry sending pending tasks that failed due to server validation. Let’s see how it works.
Handling failure from the server-side
You may decide to reject an action sent to the server by mobile users for any given reason. For example, this may be because the action parameters sent do not match the expected values on the server-side.
In that case, you can send feedback to your app users, telling them that something went wrong server-side using statusText:
$response:=New object("success"; False; "statusText"; "Please check your entry and send again"))
You can even be more specific, by adding and displaying errors through action parameters:
$response.errors:=New collection(New object("parameter"; “Status; "message"; "Status field should be equal to Validated")
This will allow application users to see exactly what went wrong on the server-side and help them change the exact parameter that needs to be changed.
Mobile App Side
Now let’s look at the mobile user experience. When a pending task is sent to the server and fails due to server validation, here’s what the mobile user gets:
As you can see, they can easily modify and send these actions to the server again.
Feel free to comment on the 4D forum, and check the dedicated documentation for more details.