/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2011 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK


CREATE OR REPLACE TRIGGER XXAS_PER_IMAGES_ARIUD
  AFTER INSERT OR UPDATE OR DELETE ON per_images
  FOR EACH ROW
DECLARE
  l_req_id   NUMBER;
  l_result   BOOLEAN;
BEGIN
  l_result   := fnd_request.set_mode (TRUE);
 
 xxas_per_image_pkg.per_image_ariud(nvl(:new.parent_id, :old.parent_id));

 l_req_id   := FND_REQUEST.SUBMIT_REQUEST
                 (application => 'XXAS'
                 ,program     => 'XXAS_UPDATE_TMB'
                 ,argument1   => (nvl(:new.parent_id,:old.parent_id))
                 ,argument2   => (:new.image_id)
                 );
END;
/
COMMIT;
EXIT;