DBA Data[Home] [Help]

TRIGGER: APPS.FA_MASS_ADDITIONS_BRI

Source

Description
fa_mass_additions_bri
BEFORE  INSERT  ON fa_mass_additions
REFERENCING
 NEW AS NEW
 OLD AS OLD
FOR EACH ROW

Type
BEFORE EACH ROW
Event
INSERT
Column
When
Referencing
REFERENCING NEW AS NEW OLD AS OLD
Body
DECLARE

v_asset_id number;
Begin
 /* $Header: faxtrg01.sql 115.1 2002/01/02 07:51:23 pkm ship        $ */

 if ( :NEW.transaction_type_code = 'FUTURE ADD') then

      if ( :NEW.asset_id is null AND
           :NEW.posting_status = 'POST' ) then

           select fa_additions_s.nextval
           into v_asset_id
           from dual;

            :NEW.asset_id := v_asset_id ; --fa_additions_s.nextval;

      if :NEW.asset_number is null then
         :NEW.asset_number := v_asset_id;
      end if;
     end if;

     -- we need this check to make sure asset_number is populated
     -- if the user deletes the asset_number after the row was set to POST
     --
     if ( :NEW.asset_id is not null AND
          :NEW.asset_number is null ) then

        :NEW.asset_number := :NEW.asset_id;
     end if;
 end if;

End;