2 Replies Latest reply: Jan 10, 2012 8:50 AM by user275751 RSS

    Error while creating contact through API in Install Base

    user275751
      Hello

      I am trying to create contacts when creating a install base through API...

      I tried below code as per metalink note# 215456.1 and giving the below error. I checked setup andI have 'Ship To' exists in Instnace Party Account Relationsship setup in the aplication and also I have a party Id 1232890 exist in hz_parties table with party type as 'Person' and I passed contact_ip_id as instance_party_id from CSI_I_PARTIES table for the instance to be update...

      Also, can anybody help me how to purge the error messages before calling the API, suppose if i have 2 records and all two records will error then my second record error getting contatenated with my first error and message count also getting increased(see error message below as message count coming as 2 even though there is only one error)


      SET SERVEROUTPUT ON SIZE 1000000

      DECLARE
      p_instance_rec CSI_DATASTRUCTURES_PUB.INSTANCE_REC;
      p_ext_attrib_values_tbl
      CSI_DATASTRUCTURES_PUB.EXTEND_ATTRIB_VALUES_TBL;
      p_party_tbl CSI_DATASTRUCTURES_PUB.PARTY_TBL;
      p_account_tbl CSI_DATASTRUCTURES_PUB.PARTY_ACCOUNT_TBL;
      p_pricing_attrib_tbl CSI_DATASTRUCTURES_PUB.PRICING_ATTRIBS_TBL;
      p_org_assignments_tbl CSI_DATASTRUCTURES_PUB.ORGANIZATION_UNITS_TBL;

      p_asset_assignment_tbl CSI_DATASTRUCTURES_PUB.INSTANCE_ASSET_TBL;
      p_txn_rec CSI_DATASTRUCTURES_PUB.TRANSACTION_REC;
      x_instance_id_lst CSI_DATASTRUCTURES_PUB.ID_TBL;
      x_return_status VARCHAR2(2000);
      x_msg_count NUMBER;
      x_msg_data VARCHAR2(2000);
      x_msg_index_out NUMBER;
      t_output VARCHAR2(2000);
      t_msg_dummy NUMBER;

      BEGIN
      p_party_tbl(1).instance_party_id := null;
      p_party_tbl(1).instance_id := 1216497;
      p_party_tbl(1).party_source_table := 'HZ_PARTIES';
      p_party_tbl(1).party_id := 1232890;
      p_party_tbl(1).relationship_type_code := 'Ship To';
      p_party_tbl(1).contact_flag := 'Y';
      p_party_tbl(1).contact_ip_id := 1699185;
      x_msg_count := 0;
      p_party_tbl(1).OBJECT_VERSION_NUMBER := 1;



      -- Now call the stored program
      csi_item_instance_pub.update_item_instance(
      1.0,
      'F',
      'F',
      1,
      p_instance_rec,
      p_ext_attrib_values_tbl,
      p_party_tbl,
      p_account_tbl,
      p_pricing_attrib_tbl,
      p_org_assignments_tbl,
      p_asset_assignment_tbl,
      p_txn_rec,
      x_instance_id_lst,
      x_return_status,
      x_msg_count,
      x_msg_data);

      -- Output the results
      if x_msg_count > 0
      then
      for j in 1 .. x_msg_count loop
      fnd_msg_pub.get
      ( j
      , FND_API.G_FALSE
      , x_msg_data
      , t_msg_dummy
      );
      t_output := ( 'Msg'
      || To_Char
      ( j
      )
      || ': '
      || x_msg_data
      );
      dbms_output.put_line
      ( SubStr
      ( t_output
      , 1
      , 255
      )
      );
      end loop;
      end if;

      dbms_output.put_line('x_return_status = '||x_return_status);
      dbms_output.put_line('x_msg_count = '||TO_CHAR(x_msg_count));
      dbms_output.put_line('x_msg_data = '||x_msg_data);

      -- COMMIT;
      END;
      /



      ERROR

      --------------------------

      SQL> @p
      Msg1: The Party Relationship Type (Ship To) entered is either invalid or it does
      not exist in the Installed Base Lookups
      Msg2: The Party Relationship Type (Ship To) entered is either invalid or it does
      not exist in the Installed Base Lookups
      x_return_status = E
      x_msg_count = 2
      x_msg_data = The Party Relationship Type (Ship To) entered is either invalid or
      it does not exist in the Installed Base Lookups

      PL/SQL procedure successfully completed.
        • 1. Re: Error while creating contact through API in Install Base
          Hussein Sawwan-Oracle
          What is your application release?

          Please see these docs.

          The Party Relationship Type (X) Entered Is Either Invalid Or It Does Not Exist [ID 738120.1]
          CSI_TXN_ERROR THE PARTY RELATIONSHIP TYPE (TECHNICAL) ENTERED IS EITHER INVALID OR IT DOES NOT EXIST [ID 1081916.1]

          Thanks,
          Hussein
          • 2. Re: Error while creating contact through API in Install Base
            user275751
            Hi

            We are in 11.5.10.2 and I already checked notes which you sent before and setups are fine as the relationship type' Ship to' having 'contacts' enabled in the setup.

            I am also seeing a differernt issue as once I update existing item instnace with the status 'Return for Credit' through API, system is not allowing me to update the extended attributes through front end application manually and I am seeing a note at the end of the screen as 'Note: This item instance cannot be updated. ' and this is only happening when I update the item instance status to 'Returned for Credit' not when I create new item instances with status as 'Created'. Is this intended functionality to restrict update on extended attributes if I change the status of item instnace to 'Return for Credit' ?

            Thanks