Hi Team,
How do we display the database view data in the interface. What all related components do we need to create, like to retrieve data from table we create datatype and expression rule etc?
Discussion posts and replies are publicly visible
Hello Purvaja,
You will need a CDT, Expression rule that queries your data and an Interface. If you just want to display your data with no particular UI requirements, you can use a read only grid. You can use records as well but there might be a sync issue since you will be using view.
Thank you, that CDT should be add it to the data store?
How do we mention the entity in the expression rule?
Add it to the DataStore, and create a constant that points to the newly added DSE. Create an expression rule and use a!queryEntity() function to query the data and finally use the ER in an interface to show the data in a grid.
When we are adding the CDT that we have created from the DB view to the data store, it is showing as create to the table in the data store.
Can you please tell what to do here?
That is probably because the field names or something do not matches. You can click on the "More info" link towards the end of the line to understand what is wrong.
It is saying "a_id" is missing
The data source schema does not match the type mappings: Schema-validation: missing column [a_id] in table [`View name`]
Steps performed:
1. Created a view
2. Created a CDT with the DB view.
3. Now, trying to add this CDT to the Datastore. It is giving the above error.
Can you please help here.
Every CDT-mapped table/view has to have a primary key column or a unique column that can be treated as a primary key column. You need to alter the view definition to include a new incremental int column that you'll treat as a PK column.
Thank you
Created the PK column and this is resolved.
Amazing. Please consider verifying the answer so anyone else facing the same problem can directly look at the working solution