Delete not working, chid record found

I have a Table Records UserAreaTable that has a button "Delete" for each record. When the Delete button is clicked there is an action "DeleteUsers", that has:

1) DeleteUser entity action with id UserAreaTable.List.Current.User.Id

2) then there is an ajax refresh to the preparation qurey


3) and then an ajax refresh to update the UserAreaTable

When the Delete button for a record is clicked it shows an error "child record found" and the record is not deleted. Do you know what can be the issue? Maybe is necessary delete other record first but from which table? 

Bernardo Condé wrote:

Hi, Do you want to delete all items that are on your table?


Hi

No, just the row where the delete button was clicked. 


Sorry for the confusion, 

I got it wrong.But what you need is:

First thing, you have to see which table and record is related to the one you are trying to delete. To delete it, you must first delete the dependency that relates to that record, and then the record itself.


Bernardo Condé wrote:

First thing, you have to see which table and record is related to the one you are trying to delete. To delete it, you must first delete the dependency that relates to that record, and then the record itself.


Thanks but do you know how to find what is that record that relates to the record being deleted? 


Click on your table (there in the Date), and give an F12 in it. So it will find for you, all the places where the table and table ID are used, probably have a foreign key table of that ID of yours, you will see.


Bernardo Condé wrote:

Click the Id of your table (there in the Date), and give it an F12 in it. So it will locate for you, all the places where the table ID is used, probably has a foreign key table of that ID of your ID, you will see.



Thanks, but if I click in the DeleteUser entity action and then find usages it appear No usages found. 

1- Click Data
2- Click 1x on your table
3- Give F12
4- In the list of uses of your table, see some table that uses your ID as a Foreign Key.

So you'll know which table is locking your Delete.

Solution

I gave you an example:

I have the 2 tables:

You see, in Test2, I have the foreign key to the Test, in case I wanted to delete a test record, I need to first delete the Test2 record.


Click on your table and give F12


You will get a return from everywhere where your table is used, look something like this, to see in which table a foreign key of it is found.

As you can see, in this image I showed that Test2 uses the Test key.


Solution