# Delete Problem

**URL:** <https://forum.servoy.com/t/delete-problem/7954>\
**Category:** Classic Servoy\
**Created:** [August 2, 2007, 9:34am UTC](https://forum.servoy.com/t/delete-problem/7954 "2007-08-02T09:34:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gordon](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Gordon](https://forum.servoy.com/u/Gordon)\
**Post date:** [August 2, 2007, 9:34am UTC](https://forum.servoy.com/t/delete-problem/7954/1 "2007-08-02T09:34:16Z")

</div>

Hi

I have produced a Job Tracking solution for a client that has a number of relationships eg Job \> Hours | Job \> Expenses etc etc. Each record has a number of calculations for fee values and summary fields. In each case I have added a facility to delete a record ie remove hours from a job.

The PROBLEM is that the delete function has stopped working for some reason ie you can’t delete from my script OR from the Servoy delete icon even on a new form, with in this case hours.

My understanding is if you have hours related to a job and create a script with

forms.Job\_detail.job\_to\_hours.deleteRecord();

This should remove the hours related to the job - provided the delete facility has been enabled in the relationship. There are no events affecting this.

Going back to basics I have created an hours layout to see if I can use the Servoy delete icon and again this is not allowing delete to work. My concern is that if this is related to a calculation how do you remove records and still use the calculations to provide results eg total hours per job or for that matter aggregates of specific fields !

This may be super obvious, but I have to admit I am stumped! So any help would be appreciated

Cheers

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [August 2, 2007, 9:47am UTC](https://forum.servoy.com/t/delete-problem/7954/2 "2007-08-02T09:47:01Z")

</div>

Look into your logfiles or console. There must be somekind of error explaining why you can’t delete.

hope this helps

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [August 2, 2007, 10:10am UTC](https://forum.servoy.com/t/delete-problem/7954/3 "2007-08-02T10:10:45Z")

</div>

Hi Gordon,

Has the hours table any constraints on it ?

For example, are there any related records for hours which it is the parent of (maybe: hours → staff or hours → expense)?

In 3.5 the relation options have changed to include an ‘allow parent delete when having related records’ choice - so if this is deselected in any relationship from the hours table then it will not allow deletes to take place in the hours table !

So you may want to review the relation options for all associated relations not just the jobs-\>hours

Cheers  
Harry

---

<div class="post-metadata">

**Author:** ![Gordon](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Gordon](https://forum.servoy.com/u/Gordon)\
**Post date:** [August 2, 2007, 1:01pm UTC](https://forum.servoy.com/t/delete-problem/7954/4 "2007-08-02T13:01:17Z")

</div>

> Harry Catharell:  
> Hi Gordon,
> 
> Has the hours table any constraints on it ?
> 
> For example, are there any related records for hours which it is the parent of (maybe: hours → staff or hours → expense)?
> 
> In 3.5 the relation options have changed to include an ‘allow parent delete when having related records’ choice - so if this is deselected in any relationship from the hours table then it will not allow deletes to take place in the hours table !
> 
> So you may want to review the relation options for all associated relations not just the jobs-\>hours
> 
> Cheers  
> Harry

Thanks very much Harry - this was in fact the problem and I had not fully appreciated that any table affected within a relationship needed to have the “allow parent…” checkbox checked or it would override not only my script but Servoy’s functions too !

Cheers and thanks again

Gordon

---

<div class="post-metadata">

**Author:** ![Gordon](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Gordon](https://forum.servoy.com/u/Gordon)\
**Post date:** [August 2, 2007, 1:01pm UTC](https://forum.servoy.com/t/delete-problem/7954/5 "2007-08-02T13:01:19Z")

</div>

> Harry Catharell:  
> Hi Gordon,
> 
> Has the hours table any constraints on it ?
> 
> For example, are there any related records for hours which it is the parent of (maybe: hours → staff or hours → expense)?
> 
> In 3.5 the relation options have changed to include an ‘allow parent delete when having related records’ choice - so if this is deselected in any relationship from the hours table then it will not allow deletes to take place in the hours table !
> 
> So you may want to review the relation options for all associated relations not just the jobs-\>hours
> 
> Cheers  
> Harry

Thanks very much Harry - this was in fact the problem and I had not fully appreciated that any table affected within a relationship needed to have the “allow parent…” checkbox checked or it would override not only my script but Servoy’s functions too !

Cheers and thanks again

Gordon
