Re: deleting question again
Re: deleting question again
- Subject: Re: deleting question again
- From: James Cicenia <email@hidden>
- Date: Tue, 27 Jul 2010 13:03:17 -0500
Tried all that...
Even weirder, is that the first exception is adding a record and acts like a warning but adds the record/s properly.
However, if I try to actually delete or edit the master object it fails.
On Jul 27, 2010, at 12:54 PM, Chuck Hill wrote:
>
> On Jul 27, 2010, at 9:44 AM, James Cicenia wrote:
>
>> Hello
>>
>> I am using the following pattern. Upon creation of an object I also instantiate three related objects.
>> Upon saving, I then delete the related objects that have null data as so:
>>
>> if(att1.alertTarget()==null || att1.percentageOfAlert() == null ){
>> currentMasterAlert.removeFromAlertThresholdTargetsRelationship(att1);
>> currentMasterAlert.ctEditingContext().deleteObject(att1);
>
> IMO, better to remove it from both sides (unless removeFromAlertThresholdTargetsRelationship is doing that) OR to delete it and let the delete rules handle removing it. Doing both may confuse EOF.
>
> Chuck
>
>
>> att1 = null;
>> }
>>
>> Which throws the validation exception.
>>
>> [2010-7-27 8:50:50 CDT] <WorkerThread7> Validation failed on an object [null] with keypath = att2.alertTarget and exception: The alertTarget property of AlertThresholdTarget must have a AlertTarget assigned
>> [2010-7-27 8:50:50 CDT] <WorkerThread7> Validation failed on an object [null] with keypath = att3.alertTarget and exception: The alertTarget property of AlertThresholdTarget must have a AlertTarget assigned
>>
>> What am I missing here or doing that is making a validation rule affect the delete?
>>
>> Thanks
>> James
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> --
> Chuck Hill Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
> http://www.global-village.net/products/practical_webobjects
>
>
>
>
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden