Page 1 of 1

which event use for checking befor delete

Posted: Tue Jul 18, 2006 7:22 am
by mfa786
Sir my requirement is the system asking befor deleting record
You see my code
If found this chq in ledger file then not delete form cheqfile
Sir my question is where I put I this code
Or which event I use

select count(*) into :CHQFOUND from voumaster where cheqno=:rchqno;
if :CHQFOUND>0 then
message('Can not be del this chq is use');
message('Can not be del this chq is use');
go_item(?Chqno?);
else
message('delete your cheq');
message('delete your cheq');
commit_form;
end if;



pleas give me idea

thanks

aamir

Posted: Tue Jul 18, 2006 8:19 am
by Kashif
Use KEY-DELREC Trigeer on BLOCK Level

You can Place ur Query in this Trigger and check the record exist or Not

Best Regards.

Muhammad Kashif

Posted: Tue Jul 18, 2006 10:17 am
by mirza_rehan
Write thers code in <b>PRE-DELETE</b> trigger at block lavel

select count(*) into :CHQFOUND from voumaster where cheqno=:rchqno;
if :CHQFOUND>0 then
message('Can not be del this chq is use');
message('Can not be del this chq is use');
Raise Form_Trigger_Failure;
else
Message('delete your cheq');
message('delete your cheq');
end if;



Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family