How to delete the field data record from the table but there is no data action showing in the database tab. Is there any way to delete the record with any query?
Hi @Chetna Upadhyay ,
Open the module where you have the FieldData entity created. the CRUD actions are not directly exposed to the consumer modules. You need to create a wrapper action for the CRUD operations and set it to Public and then consume that action in your consumer module in order to use it.
Hi @Chetna Upadhyay,
As I got ! you want to delete something and you are not getting the "delete entity action" if yes!
1. Go to you Entity and change Expose Read Only to No.
2. Or you should make the wrapper action to delete the records in the module where you keep the Entities (This is the best practice)
Hope this will work for you !
Kind regards
Sourabh Sharma
Here exposed read only is disabled.
Can you give me any demo how to create the wrapper action for this table.
Hello
Maybe this video can help,https://www.youtube.com/watch?v=HJB9k7FPeEM&themeRefresh=1Also there is an article on it - https://jmjames.medium.com/outsystems-crud-wrapper-basics-e9a577a3e044#:~:text=What%20is%20a%20CRUD%20wrapper,record%20is%20accessed%20or%20changed.
Btw as I understand from your picture you are checking this in a consumer Module, Go to its producer Module.
Also I suggest you to go through the Guided path and Go through Courses and assignments.
Thanks
Hi @Chetna Upadhyay
As most of the colleges provide solutions but reply to your question how to create wrapper.
Wrapper is creating server action in your core module where you have created entity.
In this server action you can write logic to delete data.
For more details you can refer to this post- https://www.outsystems.com/forums/discussion/48437/how-do-i-do-to-create-a-createorupdateresourcewrapper/
Thanks,
Arun Rajput
Hi,
It is showing as disabled because the entity is actually present in other module. You need to open the CS module where this entity is created in order to change the properties.However as per best practice one should not expose Read Only to No.
Since for your entity it is set to YES so the entity actions (i.e Create/Update/Delete) are not visible in consumer modules and in order to access these entity actions, we wrap it inside a server action and expose it to public to be used by consumer modules.
Also you can refer these below forum discussion to understand what a wrapper action is.
https://www.outsystems.com/forums/discussion/48437/how-do-i-do-to-create-a-createorupdateresourcewrapper/
https://www.outsystems.com/forums/discussion/50345/use-wrapper-instead-of-entity-action/
Hi Chetna,
Like most of our colleges wrote, the problem is that your Entity in not from that module that you have open, is from another one and is set to be as Exposed Read Only. (and yes, you can create a wrapper to expose the Delete).
But with that, one question (or warning) arise: if you have any other Entity that refers this one by foreign key, you can have troubles in delete by the delete rules (or, in case of rule "Ignore", create dirty data). So, you can think if you want to make an hard delete or a soft delete (even for archive and historic reasons).
You can check about the soft deletes here:
https://www.outsystems.com/forums/discussion/75330/soft-delete/#Post309519
Hope this can help you think the best solution to your problem.
Best regards,
Ricardo
FYI ONLY, the DMM component on the FORGE now has as a free feature in the DELETE functionality, and when you select to delete records from a table, it will go after all the FKs/dependencies and sets them to NULL, to guarantee there is no "dirty data" when deleting.
You want to delete record from (Table) Field data .
If you have the Field data entity in another module , you should create there a public action to delete the field data record and then call this action on your module Delete.
Or
You can simply delete by using Sql Querry
delete {Table} from {table} where {table}.[attribute] = ID
Adding one more suggestion here,
If you are deleting more than 1 records then use above advanced SQL instead of looping it.
This will improve performance.
Hi , Chetna
If one post answers your question, consider marking it as a solution. That will help other community members
Regards