Thursday, 19 March 2015

Checking if supplier Id in the master block differs from that in the detail block

1. Form

2. Code

declare
    chk_button number;
    xcount number;
begin
    xcount :=0;
    if not (:suplr_mstr.suplrid=:suplr_dtls.suplrid) then
        message ('Supplier''s identity number gets posted from the master section.');
        set_alert_property('IO_ALERT', title, 'Foreign Key violation');
            set_alert_property('IO_ALERT', alert_message_text, 'Suppliers''s identity number cannot be changed.');
            chk_button := show_alert('IO_ALERT');
:suplr_mstr.suplrid:=:suplr_dtls.suplrid;
    END IF;

    END;

3. Output