Tuesday, February 13, 2018

Oracle API to Delete Form Personalization: Quick and Safe Method

DECLARE
       i_rule_key varchar2(30);
       i_rule_type varchar2(30);
       i_function_name varchar2(30);
       i_form_name varchar2(30);
    cursor c1
    is
    select * from fnd_form_custom_rules
    where id = '2222';
     
BEGIN
      fnd_form_custom_rules_pkg.
          delete_set (x_rule_key        => i_rule_key,
                      x_rule_type       => i_rule_type,
                      x_function_name   => i_function_name,
                      x_form_name       => i_form_name);
   DBMS_OUTPUT. put_line (' Personalization has been Successfully Completed');
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line ('Error: ' || SQLERRM);
END;

Oracle Forms Personalization Query Tips for Easy Customization

select fcr.id,
       fff.user_function_name,
       fcr.form_name,
       fcr.sequence,
       fcr.description,
       fcr.enabled,
       fu.user_name,
       fcr.trigger_event,
       fcr.trigger_object,
       fcr.last_update_date
from fnd_form_custom_rules fcr,
        fnd_user fu,
        fnd_form_functions_vl fff
where fcr.function_name = fff.function_name
and fcr.last_updated_by = fu.user_id
and user_name = '&user_name'
AND user_function_name = 'Quick Sales Orders';

Monday, February 12, 2018

Oracle EBS Query to Retrieve Customer Name and Account Details

select hca.account_number,
       hp.party_name,
       rcta.trx_number,
       acra.receipt_number,
       rcta.trx_date,
       acra.creation_date,
       acra.amount
from hz_parties hp,
     hz_cust_accounts hca,
     ra_customer_trx_all rcta,
     ar_cash_receipts_all acra,
     ar_receivable_applications_all araa
where hp.party_id = hca.party_id
and rcta.sold_to_customer_id = hca.cust_account_id
and araa.cash_receipt_id = acra.cash_receipt_id
and araa.applied_customer_trx_id = rcta.customer_trx_id
and account_number = '&account_number';

Thursday, February 8, 2018

Oracle EBS API to Create Application Users – Step-by-Step Guide

DECLARE
      lv_user_name varchar2(50) :='&user_name';
      lv_password varchar2(30) :='&password';
      lv_session_id integer    := userenv('sessionid');
BEGIN
   fnd_user_pkg.createuser(x_user_name           => lv_user_name,
                          x_owner                => NULL,
                          x_unencrypted_password => lv_password,
                          x_session_number       => lv_session_id,
                          x_start_date           => sysdate,
                          x_end_date             => NULL,
                          x_email_address        => NULL
                         );

       DBMS_OUTPUT.put_line('User:' || lv_user_name || 'Created Successfully');
EXCEPTION
  WHEN OTHERS THEN
    DBMS_OUTPUT.put_line('Unable to create User due to' || SQLCODE || ' ' || SUBSTR(SQLERRM, 1, 100));
END;

Tuesday, February 6, 2018

Important Oracle TCA Lookup Tables You Should Know

1. Lookup for Customer Class Code :
      select lookup_type,lookup_code,meaning
      from ar_lookups
      where lookup_type in (select class_category from HZ_CLASS_CATEGORIES);

2. Lookup for Customer Type :
       select lookup_type,lookup_code,meaning
       from ar_lookups
       where lookup_type='CUSTOMER_TYPE';

3. Lookup for Party Type :
       select lookup_type,lookup_code,meaning,description
       from ar_lookups
       where lookup_type='PARTY_TYPE';

4. Lookup for sales channel :
        select  lookup_type,lookup_code,meaning
        from oe_lookups
         where lookup_type='SALES_CHANNEL';

5. Lookup for SIC code :
        select  lookup_type,lookup_code,meaning
        from ar_lookups
        where lookup_type='SIC_CODE_TYPE';

6. Lookup for Status :
       SELECT lookup_type,lookup_code,
            meaning,
            start_date_active,
            end_date_active,
            description
     FROM ar_lookups
    WHERE lookup_type = 'REGISTRY_STATUS'
     AND enabled_flag  = 'Y';

7. Lookup for Countries :
       SELECT TERRITORY_CODE, NLS_TERRITORY
       FROM FND_TERRITORIES;

💬