4D for iOS: Update pending tasks that got rejected

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.

David Azancot
• 4D for iOS Product Owner •David Azancot joined the 4D Product team as a Product Owner in 2017. He's in charge of writing the user stories and translating them into functional specifications. His role also includes making sure that feature implementations meet customers' needs.David graduated with an MBA in Marketing, Internet and Mobility from the Leonard De Vinci Institute and began his career in 2011 with a mobile start-up company, later acquired by Madvertise (a mobile marketing group). Passionate about mobile interfaces, he was the natural choice to develop interactive mobile ad formats for the group in 2015. In parallel, David has been developing his own iOS and Android applications since 2012.