Sunday, September 6, 2015

API to Add Existing Action Type

DECLARE
   l_application_name      VARCHAR2 (500)
                              := 'Oracle Self Service Human Resources';
   l_action_type_name      VARCHAR2 (1000)
                              := 'approval-group chain of authority';
   l_voting_regime         VARCHAR2 (10) := NULL;
   l_order_number          NUMBER := 1;
   l_chain_ordering_mode   VARCHAR2 (10) := NULL;
BEGIN
   -- Voting Regime
   SELECT lookup_code
     INTO l_voting_regime
     FROM fnd_lookups
    WHERE lookup_type = 'AME_ACT_VOTING_REGIME'
          AND UPPER (meaning) = 'SERIAL';

   -- Order Mode
   SELECT lookup_code
     INTO l_chain_ordering_mode
     FROM fnd_lookups
    WHERE lookup_type = 'AME_COA_ORDERING_MODE'
          AND UPPER (meaning) = 'SERIAL';

   ame_action_type_config_api.
    load_row (x_application_name      => l_application_name,
              x_action_type_name      => l_action_type_name,
              x_voting_regime         => l_voting_regime,
              x_order_number          => l_order_number,
              x_chain_ordering_mode   => l_chain_ordering_mode,
              x_owner                 => NULL,
              x_last_update_date      => SYSDATE,
              x_custom_mode           => NULL);
   COMMIT;
   DBMS_OUTPUT.put_line ('Action Type Config Loaded Successfully ');
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
END;



SELECT *
  FROM ame_action_type_config

 WHERE application_id = -91 AND SYSDATE BETWEEN start_date AND end_date

No comments:

Post a Comment