1 Reply Latest reply: Jun 22, 2014 3:30 AM by rthampi RSS

    Create Contact details @ Customer Account Site

    rthampi

      Hi guys

       

      After loads of efforts I managed to create a contact @ Customer Account Site level using below API Call

      DECLARE
      p_cr_cust_acc_role_rec HZ_CUST_ACCOUNT_ROLE_V2PUB.cust_account_role_rec_type;
      x_cust_account_role_id NUMBER;
      x_return_status VARCHAR2(2000);
      x_msg_count NUMBER;
      x_msg_data VARCHAR2(2000);
      
      
      BEGIN
      
      
      -- NOTE:
      -- must be unique CUST_ACCOUNT_ID, PARTY_ID,ROLE_TYPE
      -- must be unique CUST_ACCT_SITE_ID, PARTY_ID,ROLE_TYPE
      
      
      p_cr_cust_acc_role_rec.party_id := 2126134; --value for party_id from step 8>
      p_cr_cust_acc_role_rec.cust_account_id := 999059; --value for cust_account_id from step 2>
      p_cr_cust_acc_role_rec.primary_flag := 'Y';
      p_cr_cust_acc_role_rec.role_type := 'CONTACT';
      p_cr_cust_acc_role_rec.created_by_module := 'TCA_V2_API';
      
      
      ---For attaching the contact to a particular site
      p_cr_cust_acc_role_rec.cust_acct_site_id := 29422; --Value for x_cust_acct_site_id from step >5
      ---
      
      
      
      
      HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_role(
      'T',
      p_cr_cust_acc_role_rec,
      x_cust_account_role_id,
      x_return_status,
      x_msg_count,
      x_msg_data);
      
      
       dbms_output.put_line('***************************');
       dbms_output.put_line('Output information ....');
       dbms_output.put_line('***************************');
       dbms_output.put_line('x_cust_account_role_id: '||x_cust_account_role_id);
       dbms_output.put_line('x_return_status: '||x_return_status);
       dbms_output.put_line('x_msg_count: '||x_msg_count);
       dbms_output.put_line('x_msg_data: '||x_msg_data);
       dbms_output.put_line('***************************');
      
      
       IF x_msg_count >1 THEN
        FOR I IN 1..x_msg_count
         LOOP
          dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
        END LOOP;
       END IF;
      
          IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
       COMMIT;
       ELSE
       ROLLBACK;
       END IF;
      
      
      END;
      

       

      Now I want to attach "Address/Email/Phone number" to this contact @ the Account site level. Please let me know how and which APIs I need to call

       

      Regards,

       

      Raj

        • 1. Re: Create Contact details @ Customer Account Site
          rthampi

          Okay I found the solution.

           

          Reference material : How to Create Contact,Phone, Email under Communication tab for Customer Account Site using API [ID 985500.1]

          docs.oracle.com/cd/B34956_01/current/acrobat/120hztig.pdf

           

          Repeat Run --3. Create a physical location with customer account site level Address (ie, Specific contact address details). Note down x_location_id value

          GET "x_party_id: " from "--8. Create a relation cont-org using party_id from step 7 and party_id from step 2"

           

          Now Run "--4. Create a party site using party_id from step 2 and location_id from step 3" passing "x_party_id" from Step 8 & x_location_id from Step 3

          Commit the changes and you will able to populate the account site specific contact person details

           

          Regards,

           

          rajesh