How to execute lists in the WebAPI?
The best way to retrieve data from the database is using the lists created in the ERP, that can be executed using WebAPI requests. This process has several advantages, for example, safety and information confidentiality, ensured by the ERP and by the fact that it avoids the SQL injection into the database. There are two types of lists and both of them can be executed with or without parameters: These lists are directly associated to the ERP categories (Items, Clients, etc.). To execute them, the request route must specify the category, followed by the list identifier and whose parameters you consider necessary. Route: Example: These lists are based on SQL queries and are not connected to ERP categories. Using adhoc lists, you can use SQL instructions to retrieve any information from the database. You can also use entry parameters in adhoc lists requests. Route: Example: The entry parameters for lists (structured or adhoc) must be specified in the request route, inside the variable listParameters and separated by a comma. The parameter order should be exactly the same used in the ERP parameter collection screen, when the list is executed. Route: Example: You can also use the default lists in each ERP category to retrieve that request parameterized information when invoking the category. Route: Example:Structured lists
{{apiUrl}}Plataforma/Listas/CarregaLista/[Categoria]?listId=[Id]
{{apiUrl}}Plataforma/Listas/CarregaLista/Artigo?listId=FE2E9AA6-5851-4F41-BF9B-1169AFEB7BE8
Adhoc lists
{{apiUrl}}Plataforma/Listas/CarregaLista/adhoc/?listId=[Id]
{{apiUrl}}Plataforma/Listas/CarregaLista/adhoc/?listId=E74715FC-6CFB-4CFC-B810-5A50E120550D
Parameters
{{apiUrl}}Plataforma/Listas/CarregaLista/adhoc/?listId=[Id]&listParameters=[Param1],[Param2]
{{apiUrl}}Plataforma/Listas/CarregaLista/adhoc/?listId=0AEA772A-FAA1-11E2-8941-000C29012C68&listParameters=2019,SOFRIO
Default lists
{{apiUrl}}Plataforma/Listas/CarregaLista/[Categoria]
{{apiUrl}}Plataforma/Listas/CarregaLista/Artigo
login para deixar a sua opinião.