Auto Refresh of a form

Hey,

is there a way to automatically refresh the view of a form (menu item), without pressing F5.
The F5 mehtod has the downside on our system, that the user has to login again.

Thx,

Fabian

Hello,

There is currently no way to refresh a form per say.

With a data view, there is the ability to refresh via:

five.refreshDataView()

Would you potentially be able to give me an example of what you are trying to do and I can take a look into it for you.

Thanks,
Riley.

Hey Riley,

thank you for your reply.

I am planning a multi user Application with two roles, administrator and worker. Administrator is typing in tasks for the worker and the worker receives and fulfills the tasks.
The Problem, is for the worker to see his recently assgigned tasks, he needs to refresh the app / the form every time manually, resulting in a re-login for him. That is kind of not very productive.

Let meh show you with two Screenshots to explain.
In this one, a member of role administrator has created a task (see left side of the screen) and saved it but a worker wont see it immediatly (see right side of the screen):

After the worker has pressed F5 and re logged in, he can see the assigned task:

It would be greate if there is a way to make this more dynamically.

Thanks,

Fabian

Second Screenshot due to new user limitation :wink:

Hello Fabian,

Unfortunately there is no way to force automatic updates with a form, however, I can suggest an alternative.

You could make use of a Data View and a live query. So instead of a worker seeing a form under the menu ‘Auftrag’, they would see a Data View which displays all the tasks set to them. Within this Data View, you could also include a button called ‘View Task’ which then takes the user to the corresponding form entry. You could also include a button called ‘Complete Task’, or any button you like really to achieve a specific task.

Be sure to set the query to live as this will tell the system to refresh the Data View whenever an update is made. You may also need to call the function:

I feel this would also be a better look from a worker perspective as you would be able to incorporate a central view containing more data related to each task.

If you would like an example of how this works, I’d be happy to provide one, just let me know!

Thanks,
Riley.

Hey Riley,

thank you.

Would you be so kind and show me a code example for “View Task” as I have a simliar problem with another dataform.

I want a data View to show all tasks that have not been marked done - no problem with the SQL builder :slight_smile:
But it would be cool if you click on one of these tasks and see extended task details.

Thanks,

Fabian

I have seen there are several options that might help:

Hello,

I will provide a short explanation as well as an FDF to show you how to incorporate this functionality.


In the query you use for your Data View, be sure to include the table key (this will not be shown on the Data View, however, is essential to ensure the record shows up when clicking the button).


This will not be show in action within my FDF but regarding your previous issue with an auto refresh, be sure to turn on the ‘Live’ switch on the query.

Note: A popular functionality when using buttons within a Data View is the incorporation of a ‘Go Back’ button. Meaning when you press a button that takes you to a form record, you can have a ‘Go Back’ button at the top of the form which takes you back to the Data View. I will show how to do this, however, it is not an essential requirement, just a user friendly addition.


Within your Data View, click into the table key field and set the ‘Show If’ field to false.


Add a new field, set the ‘Display Type’ field to _Button, and leave the ‘Field’ value blank. The ‘Caption’ and ‘Field ID’ values are up to you depending on what you want the button to say.


Create a new Java Script function, this will be attached to the ‘On Click’ event of the button within the Data View.

five.selectAction(ActionID, TableKey)

This function is essential, using the Action ID of the form you wish to select, and then the corresponding key of the Data View row, this function will take the user to the form and present them with the corresponding record they clicked.

five.setVariable(VariableName, Value)

This function has been made for the functionality of the Go Back button.


Go to your Data View and attach this to the ‘On Click’ event of the previously created button. Now, run your application, when you click the button, you should be taken to the form with the clicked record automatically displayed.

Optional: Go Back Button


Create a new function in which uses selectAction along with the Action ID of the Data View you wish to go back to. Also set the previously declared variable to false.


Go to the form and add an Action Button.


Give the button a name, set the ‘Show If’ field equal to the variable you previously declared, and attach the new function to the ‘On Press’ event of the button.

Picture Demo
I will show a series of photos, first I will click the Jane Doe field on the Data View, then I will show where it takes me, then I will press the Go Back button and show where it takes me.



In the past when using a multi-user application with this functionality, I have also had to adjust some filtering methods on the form so that the user can only see their corresponding tasks. I have not seen your full application, but from what I have seen, yours appears to do this already, however, if you experience any issues with this just let me know!

Here is the FDF:
DVButton-20241219-222957212237697.fdf (3.4 MB)

Let me know if you have any issues,

Thanks,
Riley.

One more note:

r
If you don’t want a completely new button field, you can also attach it to the ‘On Click’ event of any field within the Data View. In this image, I attached it to the First Name field.

Thanks,
Riley.