Re: developer 2000 key-delrec

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Wed, 5 Apr 2000 09:31:51 +0100
Message-ID: <rOZ4RtA3nv64Ewd3_at_ahardy.demon.co.uk>


In article <8cdp0v$uca$1_at_nnrp1.deja.com>, ssharma24_at_my-deja.com writes

>My question is:
>Although I do have a key-delrec to stop the deletion of a “record”, but
>I am being able to delete the ‘name’ field. I don’t want user to be
>able to delete the ‘name’ field if the id related to it has child
>records.

Not quite sure what you mean by 'able to delete the name field'. Do mean that pressing the delete key will delete the record if the name field is currently selected? Or do you mean that you can change/update the name field when there are child records and you wish to prevent this?

A key-delrec trigger on the *block* should cope well with preventing the deletion of records with children e.g.

IF function_children_found(:block.id) THEN

        --
        -- use a message or an alert to let the user know
        --
        RAISE FORM_TRIGGER_FAILURE;
ELSE
        delete_record;

END IF; assuming that your function_children_found returns Boolean TRUE - don't forget that you can always refer to all parts of the block, you don't need the name-to-id lookup.

If you want to prevent updates, do the same thing with the pre-update trigger.

Andy

-- 
Andy Hardy. PGP ID: 0xA62A4849
===============================================================
Received on Wed Apr 05 2000 - 10:31:51 CEST

Original text of this message