DBA Data[Home] [Help]

APPS.CS_SR_PARTY_MERGE_PKG dependencies on CS_HZ_SR_CONTACT_POINTS

Line 1183: from cs_hz_sr_contact_points

1179: x_return_status OUT NOCOPY VARCHAR2)
1180: IS
1181: cursor c1 is
1182: select 1
1183: from cs_hz_sr_contact_points
1184: where sr_contact_point_id = p_from_id
1185: and party_id = p_from_fk_id
1186: and contact_type <> 'EMPLOYEE'
1187: for update nowait;

Line 1244: -- In the case of CS_HZ_SR_CONTACT_POINTS table, if party id 1000 gets merged to

1240: -- dependent record exists on the new parent. If a duplicate exists then do
1241: -- not transfer and return the id of the duplicate record as the Merged To Id
1242:
1243:
1244: -- In the case of CS_HZ_SR_CONTACT_POINTS table, if party id 1000 gets merged to
1245: -- party id 2000 then, we have to update all records with customer_id = 1000 to 2000
1246:
1247: if p_from_fk_id <> p_to_fk_id then
1248: begin

Line 1251: arp_message.set_token('TABLE_NAME', 'CS_HZ_SR_CONTACT_POINTS', FALSE);

1247: if p_from_fk_id <> p_to_fk_id then
1248: begin
1249: -- obtain lock on records to be updated.
1250: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1251: arp_message.set_token('TABLE_NAME', 'CS_HZ_SR_CONTACT_POINTS', FALSE);
1252:
1253: open c1;
1254: close c1;
1255:

Line 1259: --record in cs_hz_sr_contact_points

1255:
1256:
1257: BEGIN
1258: --Before updating the record with the new party id, check if it will result in a duplicate
1259: --record in cs_hz_sr_contact_points
1260: --If so, need to set one of them to DUPLICATE
1261:
1262: --dbms_output.put_line('getting v_merged_to_id');
1263:

Line 1267: from cs_hz_sr_contact_points

1263:
1264: --V_MERGED_TO_ID will have the SR_CONTACT_POINT_ID which results in a duplicate record
1265: --
1266: select sr_contact_point_id INTO v_merged_to_id
1267: from cs_hz_sr_contact_points
1268: where party_id = p_to_fk_id
1269: and ( contact_point_id, incident_id ) = ( select contact_point_id, incident_id
1270: from cs_hz_sr_contact_points
1271: where sr_contact_point_id = p_from_id )

Line 1270: from cs_hz_sr_contact_points

1266: select sr_contact_point_id INTO v_merged_to_id
1267: from cs_hz_sr_contact_points
1268: where party_id = p_to_fk_id
1269: and ( contact_point_id, incident_id ) = ( select contact_point_id, incident_id
1270: from cs_hz_sr_contact_points
1271: where sr_contact_point_id = p_from_id )
1272: and sr_contact_point_id <> p_from_id
1273: and contact_type <> 'EMPLOYEE'
1274: and rownum = 1;

Line 1290: UPDATE CS_HZ_SR_CONTACT_POINTS

1286: --Hence, just update the record with the new party id.
1287:
1288: ----dbms_output.put_line('hi 1' || v_merged_to_id);
1289:
1290: UPDATE CS_HZ_SR_CONTACT_POINTS
1291: SET party_id = p_to_fk_id,
1292: object_version_number = object_version_number + 1,
1293: last_update_date = SYSDATE,
1294: last_updated_by = G_USER_ID,

Line 1364: --Found a record which would create duplicates in cs_hz_sr_contact_points

1360:
1361: ELSE ---found a dup record
1362:
1363:
1364: --Found a record which would create duplicates in cs_hz_sr_contact_points
1365: --HEnce, mark the the other found record as duplicate and update the current
1366: --one which needs to updated with the new party id. WHile marking the record
1367: --as DUPLICATE, check if it is the PRIMARY CONTACT. IF so, make the current one
1368: --which is going to be updated with new party id, as PRIMARY CONTACT

Line 1372: CS_HZ_SR_CONTACT_POINTS

1368: --which is going to be updated with new party id, as PRIMARY CONTACT
1369:
1370: --Found a record whcih results in duplicate, hence delete it
1371: DELETE FROM
1372: CS_HZ_SR_CONTACT_POINTS
1373: WHERE sr_contact_point_id = v_merged_to_id
1374: RETURNING primary_flag INTO l_primary_flag ;
1375:
1376:

Line 1380: UPDATE CS_HZ_SR_CONTACT_POINTS

1376:
1377: ---dbms_output.put_line('hi 2' || v_merged_to_id);
1378:
1379: IF l_primary_flag= 'N' OR l_primary_flag IS NULL THEN
1380: UPDATE CS_HZ_SR_CONTACT_POINTS
1381: SET party_id = p_to_fk_id,
1382: object_version_number = object_version_number + 1,
1383: last_update_date = SYSDATE,
1384: last_updated_by = G_USER_ID,

Line 1454: UPDATE CS_HZ_SR_CONTACT_POINTS

1450:
1451: ELSE
1452: --PRIMARY_FLAG of the deleted record was Y, hence make this record as primary
1453: ---dbms_output.put_line('hi 3' || v_merged_to_id);
1454: UPDATE CS_HZ_SR_CONTACT_POINTS
1455: SET party_id = p_to_fk_id,
1456: object_version_number = object_version_number + 1,
1457: last_update_date = SYSDATE,
1458: last_updated_by = G_USER_ID,

Line 1554: 'CS_HZ_SR_CONTACT_POINTS for party_id = ' || p_from_fk_id );

1550: raise;
1551: WHEN resource_busy then
1552: arp_message.set_line(g_proc_name || '.' || l_api_name ||
1553: '; Could not obtain lock for records in table ' ||
1554: 'CS_HZ_SR_CONTACT_POINTS for party_id = ' || p_from_fk_id );
1555: x_return_status := FND_API.G_RET_STS_ERROR;
1556: raise;
1557:
1558: WHEN others then

Line 1584: FROM cs_hz_sr_contact_points

1580: x_return_status OUT NOCOPY VARCHAR2)
1581: IS
1582: CURSOR c1 IS
1583: SELECT 1
1584: FROM cs_hz_sr_contact_points
1585: WHERE sr_contact_point_id = p_from_id
1586: AND contact_point_id = p_from_fk_id
1587: AND contact_type <> 'EMPLOYEE'
1588: FOR UPDATE NOWAIT;

Line 1645: -- In the case of CS_HZ_SR_CONTACT_POINTS table, if party id 1000 gets merged to party

1641: -- dependent record to the new parent. Before transferring check if a similar
1642: -- dependent record exists on the new parent. If a duplicate exists then do
1643: -- not transfer and return the id of the duplicate record as the Merged To Id
1644:
1645: -- In the case of CS_HZ_SR_CONTACT_POINTS table, if party id 1000 gets merged to party
1646: -- id 2000 then, we have to update all records with customer_id = 1000 to 2000
1647:
1648: IF p_from_fk_id <> p_to_fk_id then
1649: begin

Line 1652: arp_message.set_token('TABLE_NAME', 'CS_HZ_SR_CONTACT_POINTS', FALSE);

1648: IF p_from_fk_id <> p_to_fk_id then
1649: begin
1650: -- obtain lock on records to be updated.
1651: arp_message.set_name('AR', 'AR_LOCKING_TABLE');
1652: arp_message.set_token('TABLE_NAME', 'CS_HZ_SR_CONTACT_POINTS', FALSE);
1653:
1654: open c1;
1655: close c1;
1656:

Line 1665: from cs_hz_sr_contact_points

1661: --check if the merge results in a dupliacte record.
1662: --V_MERGED_TO_ID will have the SR_CONTACT_POINT_ID of the duplicate record.
1663:
1664: select sr_contact_point_id INTO v_merged_to_id
1665: from cs_hz_sr_contact_points
1666: where contact_point_id = p_to_fk_id
1667: and ( party_id, incident_id ) = ( select party_id, incident_id
1668: from cs_hz_sr_contact_points
1669: where sr_contact_point_id = p_from_id )

Line 1668: from cs_hz_sr_contact_points

1664: select sr_contact_point_id INTO v_merged_to_id
1665: from cs_hz_sr_contact_points
1666: where contact_point_id = p_to_fk_id
1667: and ( party_id, incident_id ) = ( select party_id, incident_id
1668: from cs_hz_sr_contact_points
1669: where sr_contact_point_id = p_from_id )
1670: and sr_contact_point_id <> p_from_id
1671: and contact_type <> 'EMPLOYEE'
1672: and rownum = 1;

Line 1689: UPDATE CS_HZ_SR_CONTACT_POINTS

1685: --Did'nt find any record which would result in duplicate
1686: --dbms_output.put_line('going to update ct pd ');
1687: --dbms_output.put_line(' meged id is null');
1688:
1689: UPDATE CS_HZ_SR_CONTACT_POINTS
1690: SET contact_point_id = p_to_fk_id,
1691: object_version_number = object_version_number + 1,
1692: last_update_date = SYSDATE,
1693: last_updated_by = G_USER_ID,

Line 1762: --Found a record which would create duplicates in cs_hz_sr_contact_points

1758: END LOOP ;
1759:
1760:
1761: ELSE --found dup rec
1762: --Found a record which would create duplicates in cs_hz_sr_contact_points
1763: --HEnce, mark the the other found record as duplicate and update the current
1764: --one which needs to updated with the new party id. WHile marking the record
1765: --as DUPLICATE, check if it is the PRIMARY CONTACT. IF so, make the current one
1766: --which is going to be updated with new party id, as PRIMARY CONTACT

Line 1771: DELETE FROM CS_HZ_SR_CONTACT_POINTS

1767:
1768: --Found a record which would result in duplicate. hence delete it
1769: ---dbms_output.put_line('merged id is not null');
1770:
1771: DELETE FROM CS_HZ_SR_CONTACT_POINTS
1772: WHERE SR_CONTACT_POINT_ID = v_merged_to_id
1773: RETURNING primary_flag INTO l_primary_flag ;
1774:
1775: IF l_primary_flag= 'N' OR l_primary_flag IS NULL THEN

Line 1778: UPDATE CS_HZ_SR_CONTACT_POINTS

1774:
1775: IF l_primary_flag= 'N' OR l_primary_flag IS NULL THEN
1776: ---dbms_output.put_line('primary flag is N');
1777:
1778: UPDATE CS_HZ_SR_CONTACT_POINTS
1779: SET contact_point_id = p_to_fk_id,
1780: object_version_number = object_version_number + 1,
1781: last_update_date = SYSDATE,
1782: last_updated_by = G_USER_ID,

Line 1850: UPDATE CS_HZ_SR_CONTACT_POINTS

1846: END LOOP ;
1847: ELSE
1848: --PRIMARY_FLAG of the deleted record was Y, hence make this record as primary
1849: ---dbms_output.put_line('primary flag is Y');
1850: UPDATE CS_HZ_SR_CONTACT_POINTS
1851: SET contact_point_id = p_to_fk_id,
1852: object_version_number = object_version_number + 1,
1853: last_update_date = SYSDATE,
1854: last_updated_by = G_USER_ID,

Line 1948: 'CS_HZ_SR_CONTACT_POINTS for contact_point_id = ' || p_from_fk_id );

1944: RAISE;
1945: when resource_busy then
1946: arp_message.set_line(g_proc_name || '.' || l_api_name ||
1947: '; Could not obtain lock for records in table ' ||
1948: 'CS_HZ_SR_CONTACT_POINTS for contact_point_id = ' || p_from_fk_id );
1949: x_return_status := FND_API.G_RET_STS_ERROR;
1950: raise;
1951:
1952: when others then