Hi,
I am trying to make POC application.
requirement like i want delete parent record and child records also with associated.
example:- i have two entities State and city, state have multiple cities. so i now want delete state and cities which are associated with that sateId.
i tied with Delete Rule in Cities entity for the StateId reference attribute.
can you please suggest me.
Hi @kishore reddy
In Delete rule there is one more thing to notice if your reference is in more then one entity and if you Opted Delete only for one and protect for another then it'll also give exception.
So better just create a action pass Id which you want to delete and use SQL statement to Delete all records by using where clause.
You can also maintain a flag Active or Inactive to avoid permanent data deletion.
The solution which @Dorine Boudry mention will also work but for this u need to check all reference.
I hope it'll also help you.
ThanksDeep
Yes, it is working now. i did not noticed that cityID reference attribute using in another entity(Towns) as refence key. i checked that and working fine. thank you
if your delete rule is set to option Delete, as you say, then deleting the state is all you need to do, the DBMS will take care of also deleting all cities referencing (being a child of) this state.
yes, i opted to Delete for StateId reference attribute.
when i trying to Delete particular record getting Data base exception. operation not performing. pls suggest me
Like this kind of exception