144
Views
11
Comments
How to delete the record from the table?

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?

UserImage.jpg
Puja Rani

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.

2022-07-03 17-24-08
Sourabh sharma

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

 


UserImage.jpg
Chetna Upadhyay

Here exposed read only is disabled. 

Can you give me any demo how to create the wrapper action for this table.

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

Maybe this video can help,
https://www.youtube.com/watch?v=HJB9k7FPeEM&themeRefresh=1

Also 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

2025-02-10 17-24-13
Arun Rajput

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

UserImage.jpg
Puja Rani

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/

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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

2017-11-17 23-02-39
Infosistema Solutions

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.

UserImage.jpg
Anjali Choudhary

Hi @Chetna Upadhyay , 

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


Thanks

2024-12-02 12-15-17
Aravind EONE

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.

2014-10-21 20-15-17
Alberto Ferreira

Hi , Chetna

If one post answers your question, consider marking it as a solution. That will help other community members

Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.