149: * IN/OUT:
150: * p_cust_account_rec Customer account record.
151: * p_person_rec Person party record which being created account
152: * belongs to. If party_id in person record is not
153: * passed in or party_id does not exist in hz_parties,
154: * API ceates a person party based on this record.
155: * p_organization_rec Organization party record which being created account
156: * belongs to. If party_id in organization record is not
157: * passed in or party_id does not exist in hz_parties,
153: * passed in or party_id does not exist in hz_parties,
154: * API ceates a person party based on this record.
155: * p_organization_rec Organization party record which being created account
156: * belongs to. If party_id in organization record is not
157: * passed in or party_id does not exist in hz_parties,
158: * API ceates a organization party based on this record.
159: * p_customer_profile_rec Customer profile record. One customer account
160: * must have a customer profile.
161: * x_return_status Return status after the call. The status can
206: l_msg_data VARCHAR2(2000);
207: l_create_party BOOLEAN := FALSE;
208:
209: l_party_id NUMBER;
210: l_party_number HZ_PARTIES.party_number%TYPE;
211: l_party_type HZ_PARTIES.party_type%TYPE;
212: l_profile_id NUMBER;
213: l_cust_account_profile_id NUMBER;
214: l_orig_system_ref_rec HZ_ORIG_SYSTEM_REF_PUB.ORIG_SYS_REFERENCE_REC_TYPE;
207: l_create_party BOOLEAN := FALSE;
208:
209: l_party_id NUMBER;
210: l_party_number HZ_PARTIES.party_number%TYPE;
211: l_party_type HZ_PARTIES.party_type%TYPE;
212: l_profile_id NUMBER;
213: l_cust_account_profile_id NUMBER;
214: l_orig_system_ref_rec HZ_ORIG_SYSTEM_REF_PUB.ORIG_SYS_REFERENCE_REC_TYPE;
215:
284: l_party_id <> FND_API.G_MISS_NUM
285: THEN
286: BEGIN
287: SELECT party_type INTO l_party_type
288: FROM HZ_PARTIES
289: WHERE PARTY_ID = l_party_id;
290:
291: IF l_party_type <> p_entity_type THEN
292: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_PARTY_TYPE' );
320: INTO l_party_id
321: FROM HZ_ORIG_SYS_REFERENCES
322: WHERE orig_system = p_person_rec.party_rec.orig_system
323: AND orig_system_reference = p_person_rec.party_rec.orig_system_reference
324: AND owner_table_name = 'HZ_PARTIES'
325: AND status = 'A';
326: EXCEPTION
327: WHEN NO_DATA_FOUND THEN
328: l_create_party := TRUE;
328: l_create_party := TRUE;
329: END;
330: BEGIN
331: SELECT party_type INTO l_party_type
332: FROM HZ_PARTIES
333: WHERE PARTY_ID = l_party_id;
334:
335: IF l_party_type <> p_entity_type THEN
336: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_PARTY_TYPE' );
358: INTO l_party_id
359: FROM HZ_ORIG_SYS_REFERENCES
360: WHERE orig_system = p_organization_rec.party_rec.orig_system
361: AND orig_system_reference = p_organization_rec.party_rec.orig_system_reference
362: AND owner_table_name = 'HZ_PARTIES'
363: AND status = 'A';
364: EXCEPTION
365: WHEN NO_DATA_FOUND THEN
366: l_create_party := TRUE;
366: l_create_party := TRUE;
367: END;
368: BEGIN
369: SELECT party_type INTO l_party_type
370: FROM HZ_PARTIES
371: WHERE PARTY_ID = l_party_id;
372:
373: IF l_party_type <> p_entity_type THEN
374: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_PARTY_TYPE' );
596: IF l_party_number IS NULL AND
597: l_party_id IS NOT NULL
598: THEN
599: SELECT party_number INTO l_party_number
600: FROM HZ_PARTIES
601: WHERE PARTY_ID = l_party_id;
602: END IF;
603:
604: -- create customer profile. Customer profile is mandatory for account. One
1486: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
1487: * p_cust_account_rec Customer account record.
1488: * p_person_rec Person party record which being created account
1489: * belongs to. If party_id in person record is not
1490: * passed in or party_id does not exist in hz_parties,
1491: * API ceates a person party based on this record.
1492: * p_customer_profile_rec Customer profile record. One customer account
1493: * must have a customer profile.
1494: * p_create_profile_amt If it is set to FND_API.G_TRUE, API create customer
1735: * FND_API.G_TRUE. Default is FND_API.G_FALSE.
1736: * p_cust_account_rec Customer account record.
1737: * p_organization_rec Organization party record which being created account
1738: * belongs to. If party_id in organization record is not
1739: * passed in or party_id does not exist in hz_parties,
1740: * API ceates a organization party based on this record.
1741: * p_customer_profile_rec Customer profile record. One customer account
1742: * must have a customer profile.
1743: * p_create_profile_amt If it is set to FND_API.G_TRUE, API create customer