Delete Problem

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Delete Problem

Postby Gordon » Thu Aug 02, 2007 11:34 am

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
Gordon McLean
Click Digital Media Ltd
SAN Developer
www.clickdigital.com
User avatar
Gordon
 
Posts: 265
Joined: Thu Mar 17, 2005 8:05 pm
Location: UK

Postby Harjo » Thu Aug 02, 2007 11:47 am

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

hope this helps
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Harry Catharell » Thu Aug 02, 2007 12:10 pm

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
Harry Catharell
 
Posts: 812
Joined: Fri Sep 26, 2003 10:23 am
Location: Milton Keynes, England

Postby Gordon » Thu Aug 02, 2007 3:01 pm

Harry Catharell wrote: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
Gordon McLean
Click Digital Media Ltd
SAN Developer
www.clickdigital.com
User avatar
Gordon
 
Posts: 265
Joined: Thu Mar 17, 2005 8:05 pm
Location: UK

Postby Gordon » Thu Aug 02, 2007 3:01 pm

Harry Catharell wrote: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
Gordon McLean
Click Digital Media Ltd
SAN Developer
www.clickdigital.com
User avatar
Gordon
 
Posts: 265
Joined: Thu Mar 17, 2005 8:05 pm
Location: UK


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 3 guests