Delete Records

Hi all, 

How to delete the data with primary key in my employee table (EmployeeId) and I use it as a foreign key in address table.

If I change the delete rule to delete of EmployeeId foreign key from child table (address)then its working but without doing any change in delete rule how can I do that?

If I wants to delete employee how should I do that?

I have attach the .oml

Delete.oml

mvp_badge
MVP
Solution

Hi Pooja,


You will need to delete the address record(s) that is binded to that EmployeeId.

You can do a query on Address filtering by that EmployeeId and then remove that record using the DeleteAddress aciton.

Since you have the Address entity in another module (Delete_db), you should create there a public action to delete the Address and then call this action on your module Delete.


I can't send you the OML since the changes should be made in two OMLs, both the Delete and the Delete_db.


Kind Regards,
João

Hi @Pooja,

If you want to delete a record from the parent entity and their record in the child entity. Then first you have to delete the record from the child entity associated with the parent entity record then perform a delete operation on the parent entity.

This will not give you an error with the delete rule set as protect.

Regards,

Narendra Bhangale. 

mvp_badge
MVP
Solution

Hi Pooja,


You will need to delete the address record(s) that is binded to that EmployeeId.

You can do a query on Address filtering by that EmployeeId and then remove that record using the DeleteAddress aciton.

Since you have the Address entity in another module (Delete_db), you should create there a public action to delete the Address and then call this action on your module Delete.


I can't send you the OML since the changes should be made in two OMLs, both the Delete and the Delete_db.


Kind Regards,
João

Hi @Pooja,

If you want to delete a record from the parent entity and their record in the child entity. Then first you have to delete the record from the child entity associated with the parent entity record then perform a delete operation on the parent entity.

This will not give you an error with the delete rule set as protect.

Regards,

Narendra Bhangale. 

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