Have problem with deleing the record

Some of the candidates still don't have their picture loaded so deleting this record are ok. But once I have their picture loaded, I encounter this problems. I know is something to do with the PersonId. I delete the first candidate with his picture loaded and it give me this problem

Soon I can try to see your OML, but I would say that you have a problem with your delete rules. So what you have to do is place your table that holds the candidates' photos with the delete rule delete. What this does, every time you delete a candidate from the entry you have in the photo table is automatically deleted. I leave you a link to see the delete rules:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships/Delete_Rules


I hope this help you,

Nuno Verdasca

Thanks. I see whether I can solve it

Hi Theow ,

I saw the oml you posted and the  issue is you have PersonId as a foreign key in PersonPhoto entity and thus you have to first delete the child records from PersonPhoto entity before you delete the record from person table.


Regards,

-PJ-

Hi Theow,

Made changes in the oml please find attched.


Regards,

-PJ-

Thanks.

Hi Theow,

If you think that this solves your problem , please mark the post as solution to stop further discussion on this.


Regrads,

-PJ-

Can I ask you one question? You just have to change the delete rule and it will sove my problem

Solution

Yes that is also one option but i thought you keep it like this by design and hence did not suggested that. Anyways happy to know that your problem is solved now.

Delete

Setting the Delete Rule to Delete guarantees that when a record of the main Entity is deleted, all the associated records in the related Entities are also deleted. This mechanism is commonly known as Cascade Delete.

This behavior is ensured by a database constraint created on the reference attribute


Regards,

-PJ-

Solution

When you give the link to the delete rule, I roughly know what I went wrong. So I just went to chage it to delete. I never use your sql solution. My mistake for making this as a solution. Sorry