In LREX0310 the decision to show the form offline or online appears to be automatic - I assume based on the availability of an internet connection.
Is it possible to call a such a form in a way that will force it to work in 'local' mode regardless of connectivity and when in this mode change it online mode (if available).
In my app I want (after initial logon and download) to work locally as much as possible but give the users the option to 'refresh' the current view by going back to the server and reloading the sql tables for the current view.
Local and Online Form
Re: Local and Online Form
I think that what you want is the property in the schema, in Longrange Studio - Its called Usage, and it can be:
Online Form
Local Form
Local Form & Online Form
For LREX0310 its currently on Local Form and Online Form, and you could change it to Local Form.
Online Form
Local Form
Local Form & Online Form
For LREX0310 its currently on Local Form and Online Form, and you could change it to Local Form.
Re: Local and Online Form
What I'm trying to implement is:
1. User logs in (online) which loads all their data to local storage.
2. They select a view called, say, 'messages. This displays their messages (downloaded to the device at 1) offline.
3. There is a button 'check for 'new messages' which goes back to the server loads new messages to local storage and then reloads the displayed list (offline).
I'm asking if it is possible to control the online/local state of a view which supports both within the code.
Would a solution to this be;
1. Load local form display messages.
2. On 'check for new messages' go to online form, load messages to local storage.
3. Go back to local form - online form is never displayed.
1. User logs in (online) which loads all their data to local storage.
2. They select a view called, say, 'messages. This displays their messages (downloaded to the device at 1) offline.
3. There is a button 'check for 'new messages' which goes back to the server loads new messages to local storage and then reloads the displayed list (offline).
I'm asking if it is possible to control the online/local state of a view which supports both within the code.
Would a solution to this be;
1. Load local form display messages.
2. On 'check for new messages' go to online form, load messages to local storage.
3. Go back to local form - online form is never displayed.
-
MarkDuignan
- Posts: 346
- Joined: Wed Apr 18, 2012 10:33 am
Re: Local and Online Form
If I understand your question correctly – then I think you may be able to do this like this …..
Make the main form an offline (only) form
In the main offline form have a button (or a command item, or an ECL script) that can run an operation of TYPE PerformAction. Set the PGM property to the name of your server program to call and set the ACTION property to something that can indicate to the program what you want it to do.
In the server program - respond with the option to NOT refresh the current form view.
Send back just a message box or a popover - something that can ‘overlay’ the current offline form views screen.
This should make your online server program act like a ‘subroutine’ of the current (offline) form view.
If the user is offline and they try to do this they should see the message “You need to be connected ….. etc”. If they are online your server ‘subroutine’ should get called and they should see a resulting message box or pop over indicating what happened. By using different ACTION property values you should be able to make one server side program service different types of offline client side requests.
Please let us know if this is what you want and whether it works as you need.
Make the main form an offline (only) form
In the main offline form have a button (or a command item, or an ECL script) that can run an operation of TYPE PerformAction. Set the PGM property to the name of your server program to call and set the ACTION property to something that can indicate to the program what you want it to do.
In the server program - respond with the option to NOT refresh the current form view.
Send back just a message box or a popover - something that can ‘overlay’ the current offline form views screen.
This should make your online server program act like a ‘subroutine’ of the current (offline) form view.
If the user is offline and they try to do this they should see the message “You need to be connected ….. etc”. If they are online your server ‘subroutine’ should get called and they should see a resulting message box or pop over indicating what happened. By using different ACTION property values you should be able to make one server side program service different types of offline client side requests.
Please let us know if this is what you want and whether it works as you need.
-
MarkDuignan
- Posts: 346
- Joined: Wed Apr 18, 2012 10:33 am
Re: Local and Online Form
I think that doing this will also cause an automatic RefreshForm operation to be issued against the offline form view.
So any SQL operations used to fill it should get automatically re-executed.
So any SQL operations used to fill it should get automatically re-executed.
Re: Local and Online Form
That sounds good!