As apps are increasing in popularity, lots of companies and developers are trying to do their part of the system. So if an app is going to be a part of a whole system, it should integrate with it.
The way that the mobile app can be integrated to the main application is by a Service Layer. Take into consideration that this service layer can or cannot be done with GeneXus.
So there is the need to be able to consume external web service without losing the main features of the Work With pattern such as Filters, Search, Paging, Orders and Break-by.
In every Grid of a Work With object, GeneXus automatically generates a service that supports the above features mentioned. So the solution is to be able to interact with third-party services (not generated by GeneXus or generated by GeneXus but with no control from the app KB). This is done by letting you interact with the interface that GeneXus Service is generated with.
In the example considered, the parameters managed by this automatic service are:
&SearchText VarChar(1000) // The Text to the search
&SearchField Numeric(10.0) // Field by we are doing the search. If 0 means all if not is the number of the att defined on the conditions tab.
&start Numeric(10.0) // States from which record the answer will bring data.
&count Numeric(10.0) // Indicates how many registers have to be brought. 0 means all.
&OrderedBy Numeric(10.0) // Indicates which order is going to be used. Base 1.
For Advanced Filters:
- Standard: the name will be "C" + <variable_name>
- Range: "C" + <variable_name> + "From" and "C"+ <variable_name> + "To"
Two paths are available to develop the examples:
- Programming the logic in the Panel object (precisely in the Load Event). Learn more: HowTo: External Services (Scenario1).
- Using a Procedure object to manage the parameters and do the mapping between the application’s Grid and the external Services. Learn more: HowTo: External Services (Scenario2).
Orders and Filters in Grids of Panels
External services - Programming the Load event
External services - Using a procedure