4 Replies Latest reply: Sep 19, 2013 6:14 AM by Vijay Nimmakuri RSS

    hz_parties error message in R12

    Jason ORCL
      I am attempting to update supplier information in R12 using the API


      POS_SUPP_CONTACT_PKG.update_supplier_contact

      And I keep getting this error message:

      "This record in table hz_parties cannot be locked as it has been updated by another user."

      Any ideas why?
        • 1. Re: hz_parties error message in R12
          Srini Chavali-Oracle
          Jason,

          Pl see if MOS Doc 389618.1 (Using TCA API Hz_party_v2pub.Update_organization Gets Error: This Record In Table HZ_PARTIES Cannot Be Locked As It Has Been Updated By Another User.) can help you.

          MOS Doc 605289.1 (After Patch 6791455 User Getting Error When Trying To Change Information For A Supplier Contact.) may also be relevant.

          HTH
          Srini
          • 2. Re: hz_parties error message in R12
            Vijay Nimmakuri
            Hi,

            I also faced a similar issue when i am updating HZ_CONTACT_POINTS using an API

            Creation of Contact Point got failed:This record in table hz_contact_points cannot be locked as it has been updated by another user.
            1) This record in table hz_contact_points cannot be locked as it has been updated by another use

            Solution:

            pass the value for "p_object_version_number" as 1 it will return 2; This you need to try on fresh record if it gets locked it takes some time (2 days or so to release).

            Sample code for   HZ_CONTACT_POINT_V2PUB.create_email_contact_point


            DECLARE
            p_contact_point_rec HZ_CONTACT_POINT_V2PUB.CONTACT_POINT_REC_TYPE;
            p_edi_rec HZ_CONTACT_POINT_V2PUB.EDI_REC_TYPE;
            p_email_rec HZ_CONTACT_POINT_V2PUB.EMAIL_REC_TYPE;
            p_phone_rec HZ_CONTACT_POINT_V2PUB.PHONE_REC_TYPE;
            p_telex_rec HZ_CONTACT_POINT_V2PUB.TELEX_REC_TYPE;
            p_web_rec HZ_CONTACT_POINT_V2PUB.WEB_REC_TYPE;
            x_return_status VARCHAR2(2000);
            x_msg_count NUMBER;
            x_msg_data VARCHAR2(2000);
            x_object_version_number NUMBER:=1;--x_contact_point_id NUMBER;

            BEGIN

            --Apps initialization.
            apps.fnd_global.apps_initialize ( user_id => 6
            ,resp_id => 53339
            ,resp_appl_id => 177
            ,security_group_id => 0);


            DBMS_OUTPUT.PUT_LINE('Calling the API hz_contact_point_v2pub.create_contact_point');

            -- Populate p_contact_point_rec and p_email_rec
            -- p_contact_point_rec.contact_point_type := 'EMAIL';
            --p_contact_point_rec.owner_table_name := 'HZ_PARTIES';
            -- p_contact_point_rec.owner_table_id := 12709304;--17619214;17692214 -- relationship_id from HZ_RELATIONSHIPS *
            p_contact_point_rec.contact_point_id := 11045;
            --p_contact_point_rec.contact_point_purpose := 'BUSINESS';
            p_contact_point_rec.created_by_module := 'POS_SUPPLIER_MGMT';--'HZ_CPUI'; --'POS_SUPPLIER_MGMT'
            -- p_contact_point_rec.orig_system_reference := 1072167539;
            --orig_system
            --content_source_type
            -- p_contact_point_rec.application_id:=177;
            -- p_email_rec.email_address := 'ISUP2AUG@MAILINATOR.COM';
            p_email_rec.email_format := 'MAILHTM2';



            -- Create Email Contact Point
            HZ_CONTACT_POINT_V2PUB.create_email_contact_point ( p_init_msg_list => fnd_api.g_false
            ,p_contact_point_rec => p_contact_point_rec
            ,p_email_rec => p_email_rec
            ,p_object_version_number => x_object_version_number
            ,x_return_status => x_return_status
            ,x_msg_count => x_msg_count
            ,x_msg_data => x_msg_data );



            IF x_return_status = fnd_api.g_ret_sts_success THEN
            COMMIT;
            DBMS_OUTPUT.PUT_LINE('Creation of Contact Point is Successful ');
            DBMS_OUTPUT.PUT_LINE('Output information ....');
            DBMS_OUTPUT.PUT_LINE('p_object_version_number = '||x_object_version_number);

            ELSE
            DBMS_OUTPUT.put_line ('Creation of Contact Point got failed:'||x_msg_data);
            ROLLBACK;
            FOR i IN 1 .. x_msg_count
            LOOP
            x_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');
            dbms_output.put_line( i|| ') '|| x_msg_data);
            END LOOP;
            END IF;
            DBMS_OUTPUT.PUT_LINE('Completion of API');
            END;

            Regards,
            Vijay Nimmakuri.
            vijay.nimmakuri@gmail.com
            • 3. Re: hz_parties error message in R12
              Sudarshan
              Hi,

              I'm facing the same issue:

              I get this error : This record in table hz_contact_points cannot be locked as it has been updated by another user.

              when using the API IBY_EXT_BANKACCT_PUB.update_ext_bank_branch.

              I've given the correct object version numbers.

              The scenario is that the branch is getting updated when I run this code for the first time in any instance. But after that, it throws this error message.

              Please help me resolve this issue.

              Here is my code:

              declare
              l_ext_bank_branch_rec IBY_EXT_BANKACCT_PUB.ExtBankBranch_rec_type;
              l_branch_id NUMBER;
              l_return_status VARCHAR2(2000);
              l_msg_count NUMBER;
              l_msg_data VARCHAR2(2000);
              l_response IBY_FNDCPT_COMMON_PUB.Result_rec_type;
              begin

              fnd_global.apps_initialize(215303,55196,200);

              l_ext_bank_branch_rec.bank_party_id := 1855452;
              l_ext_bank_branch_rec.branch_name := 'XXXXXX';
              l_ext_bank_branch_rec.branch_number := 'XXXXXX';
              l_ext_bank_branch_rec.bic := 'XXXXXX';
              l_ext_bank_branch_rec.branch_type := 'ABA';
              l_ext_bank_branch_rec.branch_party_id := 3709616;
              l_ext_bank_branch_rec.bch_object_version_number := 3;
              l_ext_bank_branch_rec.typ_object_version_number := 4;
              --l_ext_bank_branch_rec.eft_object_version_number := 3;+

              IBY_EXT_BANKACCT_PUB.update_ext_bank_branch (
              +          p_api_version => 1.0,+
              +          p_ext_bank_branch_rec => l_ext_bank_branch_rec,+
              +          x_return_status => l_return_status,+
              +          x_msg_count => l_msg_count,+
              +          x_msg_data => l_msg_data,+
              +          x_response => l_response+
              +     );+

              dbms_output.put_line('Msg Data:'||l_msg_data);

              IF l_msg_count > 1
              THEN
              FOR i IN 1 .. l_msg_count
              LOOP
              dbms_output.put_line(SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 3000));
              END LOOP;
              END IF;
              exception
              when others
              then
              dbms_output.put_line('Error : '||sqlerrm);
              end;
              • 4. Re: hz_parties error message in R12
                Vijay Nimmakuri

                Hi,

                 

                You can pass the 'object version number' what ever present in the base table the API will increment the same number for you once its sucessfullly completed.

                Let me know if that worked.
                Thanks,
                Vijay Nimmakuri