I was hoping to fetch record from a table of type view. Ed says I can, but some have said it was just for interactive reports. Just looking for clarification? Are we able to use table of type view in a logic block fetch action?
No, fetching records from a table of type View is not supported. A view table does not store data, it just contains a collection (subset) of fields from a business data table.
These are used for interactive reporting and the underlying queries are to the main table in the database. If you attempt to fetch records in a logic block, the View table should not appear in the Choose A Table field. You can fetch records from the underlying table, and the same applies if the view table is built over a join table, in which case you can fetch from the underlying join table to get all fields.
@erik.w can you clarify what Ed said about the topic? If that provided information was incorrect, we might need to look into where it came from.
I was aware that the view table did not store data. I was hoping it would act like a join table but only use the subset of fields listed in the view table. Thought that might help performance since it would not need to carry over every column.
@ross Here is what Ed said:
Yes, you can fetch data in a logic block from a table of type “view.” However, there are specific considerations and types of fetch actions available depending on the structure and purpose of the logic block:
1. Fetch Actions from Database:
- Fetch Records: Allows accessing records from a single table (including view-type tables) that is not the driver table. You can use expressions to specify the records you want to fetch.
- Fetch Records and Lock: Fetches records and locks them temporarily to prevent changes by others during the fetch operation.
- Fetch a Table Lookup: Retrieves a record from the source table but includes all fields associated with the table lookup field.
2. Fetch Actions within Logic Block:
- These fetch actions are restricted to data created and stored within the logic block and do not interact with the database directly.
3. Header and Detail Fetching:
- If the table is part of a Header-Detail structure, fetching records requires additional configurations to include details alongside the header.
4. Logic Block Types:
- Ensure the type of logic block aligns with your intended operation. For example, transactional logic blocks can fetch, update, or delete records, while UI logic blocks cannot fetch records.
Fetching data from a view-type table is possible using the appropriate fetch actions, but you need to configure the logic block inputs and outputs correctly to ensure the fetched data is utilized effectively.
Unfortunately, most of the performance cost of a query is going to be 1. The time it takes to make the round trip to the database and 2 The time it takes the database to find the record(s) being asked for. I’m guessing that the change resulting from only returning a subset of the fields would be so nominal that it’s worth returning the full payload each time.
The discussion with Ed is wrong. He provides a good synopsis of what fetch actions are possible as well as some supporting and extraneous information, but he’s misguided here.
I’ve entered a bug to investigate and fix.
OK thanks @ross. Seems like the resources needed to return all columns would be much larger especially if returning a large data set, but that is getting beyond my technical knowledge of the tool so will leave it to the experts. I appreciate the responses.