Tuesday, May 19, 2020

How to export Assets data from AP to FA

How to export Assets data from AP to FA

In order to transfer a expense line from AP to FA - (1) Track as Asset flag should be enabled (AP Invoice Lines)
(2) AP line distribution (expense) account should match with the clearing account specified in FA Book controls or category definition
(3) Transfer to GL flag should be Y (you can transfer to FA only after AP to GL transfer is complete)

Program:
Mass Additions Create
Select the FA Book and Period

Data will be transferred to FA as New records in Mass additions table.

Update the record as Assetized and assign FA Category,update the depreciation account, update employee assignments and Location (if any).

Wednesday, November 6, 2019

Oracle EBS - AP_SUPPLIER_CONTACTS was not used in R12

AP_SUPPLIER_CONTACTS will be instead of below tables.

HZ_PARTIES
HZ_RELATIONHIPS
HZ_ORG_CONTACTS
hz_contact_points 

The link column in AP_SUPPLIER_CONTACTS map tp the following tables/columns
Per_Party_ID = Party_ID of PERSON Party in HZ_PARTIES
Relationship_ID = Relationship_ID of Rows in HZ_RELATIONHIPS
Rel_Party_ID = Party_ID of PARTY_RELATIONSHIP Party in HZ_PARTIES
Party_Site_ID = Maps to the Party Site created for the PARTY_RELATIONSHIP Party
Org_Contact_ID = Org_Contact_ID from HZ_ORG_CONTACTS
Org_Party_Site_ID = Party_Site_ID of the Supplier Site row.
Assuming you know the party_site_id for an address (which is the value in AP_SUPPLIER_SITES_ALL.party_Site_ID for a site that is associated with that address) you can use this query to get the contact for that address.
SELECT PERSON.person_first_name, PERSON.person_last_name, PTY_REL.address1,
PTY_REL.City, PTY_REL.state, PTY_REL.country,
PTY_REL.Primary_phone_area_code, PTY_REL.primary_phone_number
FROM hz_parties PERSON, hz_parties PTY_REL, ap_supplier_contacts APSC
WHERE APSC.per_party_id = PERSON.party_id
AND APSC.rel_party_id = PTY_REL.party_id
AND APSC.org_party_site_id = <Party_Site_Address_ID>

Thursday, October 31, 2019

Oracle Forms - How to create an Alert or Message

How to create an Alert or Message




Oracle Forms - How to avoid duplicated records in a block


The purpose is to reject two records that contain duplicated values.



The technique used to solve this problem comes from the Kevin D Clarke’s calculated item famous solution.

It uses two calculated items, one in the data bock and another in a control block.



The first calculated item (:DEPT.MATCH_FOUND) is added to the DEPT block. It contains the formula as follow:

Comparaison(:ctrl.charsave, :dept.deptno||:dept.dname)

Notice in this case,that we want to avoid duplicates on both DEPTNO and DNAME values.

Function COMPARAISON (val1 varchar2, val2 varchar2)
Return number
Is
   answer number := 0;
Begin
   if val1 = val2 then
      answer := 1;
   end if;
   return(answer);
End;

COMPARAISON is a program unit stored in the Forms module.

The two values are compared to each other, then the function returns 1 (a value greatest than 0) if both the values are identical.
The first value (:ctrl.charsave) contains the bakup value of the current record.

The DEPT block must have the following properties setting:

Query all records
YES


The CTRL block must have the following properties setting:

Query all records
YES
Single record
YES
Database data block
NO


The second calculated item (:CTRL.MATCH_FOUND) is added to the CTRL block.
It summarize the values contained in all the rows of the DEPT block (dept.match_found).
If the total is greater than 1, we have two duplicated data.

The sample dialog

·         Download the DUPLICATES.fmb sample dialog for you to test

Friday, October 4, 2019

How to Get Previous Record Value in Oracle Forms

DECLARE
   l_prev_empno   emp.empno%TYPE;
   l_prev_ename   emp.ename%TYPE;
   l_prev_job     emp.job%TYPE;
BEGIN
   IF TO_NUMBER (:SYSTEM.cursor_record) > 1
   THEN
      PREVIOUS_RECORD; /* move to the previous record and get previous record values */
      l_prev_empno := :emp.empno;
      l_prev_ename := :emp.ename;
      l_prev_job := :emp.job;
      NEXT_RECORD;    /* come back to the current record */
   END IF;
END;

How to Check First Record and Last Record in Oracle Forms

BEGIN
   IF :SYSTEM.Cursor_Record = '1'
   THEN
      MESSAGE ('At first record.');
   END IF;
END;


BEGIN
   IF :SYSTEM.LAST_RECORD = 'TRUE'
   THEN
      MESSAGE ('At last record.');
   END IF;
END;