Unofficial Content
  • This documentation is valid for:

This KB is an example of an offline App that synchronize data by services manually implemented. That means it does't use the Automatic Offline Data Synchronization programs.

It emulates a Sales Force Automation app, that has the following characteristics:

  • When connected, the user can load all Customers to visit and Produts that can sells ( Master tables).
  • With or without internet connection, the user is able to insert Orders (Events), navigate through Product list and execute local actions, for instance, to calculate the distance to clients locations (using GPS), etc.
  • When connected, the user can send to the server all the local orders.

Getting Started

Create KB

  1. Open GeneXus
  2. File\New\Knowledge Base From GXserver. Select server https://open.genexusserver.com/v17, and chose the KB "SalesForceOffline" (use your gxtechnical credentials in order to connect to GXserver)

Backoffice deployment

  1. Set your preferred Web generator. Can be Java, .Net or Ruby.
  2. Check that the POSOfflineOfflineDatabase object has this properties values:
    • Data Receive Criteria = Never
    • Send Changes =Never
  3. On Smart Device generator, set "Generate Android" property to "True"
  4. Rebuild All and Run
  5. On the Browser execute: Menu / Initialize Server Tables  to load sample data.

SD App Deployment

For this first example, you will notice that user defined web services are being invoked in order to load local master tables from the server. So we need to indicate to the SD app the URL of our backoffice (web app) in order to retrieve the data through these web services.  To do that, open the SystemInfo domain and change the enumerated values "ServerHost", "ServerBaseURL" and "ServerPort" with your own values (taken from your web app deployment).  If you want, you can leave the default values and use a predefined web service.

After that, select the Dashboard object "POSOffline" and Run it.   Notice that the object has the Connectivity Support property with "Offline" value.

Important: It's not possible to execute an Offline App using the KBN.
If you try to run a Dashboard with Connectivity Support = Offline the KBN will crash with the following error: "The application knowledge base navigator (process com.artech.prototyper) has stopped unexpectedly. Please try again.Force Close"

Running the application

  1. Once the app is installed on the device/emulator, the first step is to load the master tables from the server. This can be done through the "Load Data" menu option.
  2. At this point you can start using the application in offline mode.
  3. Select one of the customer to visit and from "Add Products" , start to add products to the customer's order.
  4. To complete the sales process for a customer, press the "Checkout" button.
  5. To see the Orders already inserted, go to "Local Orders" menu option. There you have an option to send that orders pending to send to the server.
  6. From "Local Order" dashboard option, you can see all pendings and working orders, and by means of the "Send" menu option you can send it to the server, whenever you have internet connection
  7. The server will return the order status. Also you can check that orders from your Web backoffice application.

Hope you find it useful!

 

 

Subscribe to KB feed
KnowledgeBase SalesForceOffline
GeneXus Server URL here
No news available on this feed
Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant