Hello,
I'm a beginner, I have created a form and connected it to the data store and successfully writing the data to data store. Now in records I have many duplicates, I hate to delete them. How to do it? I've also come across using a Delete from "Data Store Entities" but in my CDT I have an ID and primary key for it. But its never showcased under records. Thus how to delete a record now.
Please refer to below screen shot
None of them are represented by an ID, but in Name hyperlink there is the Summary, though how can I delete the record. It should also be totally deleted from mysql DB.
Any suggestion would be highly appreciated...!!
Discussion posts and replies are publicly visible
Hi Nellore,
I would suggest that you review this topic in the documentation: Create a Feed-Style Record List
Follow the link and then scroll down a bit to view this detail:
You’ll notice that record values are called with the record field domain (rf!). Every field in your data source is available as a record field.
Even though you're not displaying the Id, you should be able to reference it using rf!<yourIdFieldName>.
May be I'm missing something here, What are the duplicates you are seeing in your database? Are they duplicate rows? or duplicate columns,
1. Duplicate rows: How did they get inserted, when ever you are using the write to data store entity smart service make sure that you always passing the Id field(assuming Id field is the primary key in your table and is configured in your CDT) when you want to Update a row in the DB. Passing the Id field is not mandatory for inserting a new row into DB(assuming Id field is being generated by DB from a Sequence).
2. Delete data From DB: If you want to delete the data from DB you can use Delete from Data Store Entities smart service.
this Smart service will accept entity and identifiers
={entity:<Entity Name>, identifiers:<your primary key>}
eg: {entity:pv!AMS_TASKS,identifiers:pv!taskDetails.taskID} where pv!AMS_Tasks is of type data store entity and pv!taskDetails is of type task CDT and taskId is the primary key in that CDT.
I will not recommend Hard delete from DB instead we can go with Active Indicator approach. This can be done in Project.
For record fields to display only selected columns, open your grid style record list, click on the columns, you can see all the columns that are displayed in your record and you can simply click on "X" to remove that column being displayed in the Grid.
Are you sure you want to delete the data? Generally I find it is better to have a boolean column for "active/inactive". Instead of deleting, update the row to have false for active. Then make sure to only query on active rows. Hard deletes can be dangerous, once the data is gone it may be gone forever depending on how often you backup your DB and what your logging settings are.