Wednesday, July 31, 2013

TCA API Example to Update Party Site using hz_party_site_v2pub.update_party_site

DECLARE
   l_party_site_rec   hz_party_site_v2pub.PARTY_SITE_REC_TYPE;
   l_obj_num          NUMBER := 2;
   l_return_status    VARCHAR2 (1);
   l_msg_count        NUMBER;
   l_msg_data         VARCHAR2 (2000);
BEGIN
   l_party_site_rec.party_site_id := &p_party_site_id;
   l_party_site_rec.status := '&p_status';
   l_party_site_rec.identifying_address_flag := 'p_id_address';
   l_obj_num := &p_ovn;
   hz_party_site_v2pub.update_party_site (
      p_init_msg_list           => FND_API.G_FALSE,
      p_party_site_rec          => l_party_site_rec,
      p_object_version_number   => l_obj_num,
      x_return_status           => l_return_status,
      x_msg_count               => l_msg_count,
      x_msg_data                => l_msg_data);
   DBMS_OUTPUT.put_line ('Ret Status:' || l_return_status);
   DBMS_OUTPUT.put_line ('l_msg_data:' || l_msg_data);
 
   IF l_msg_count > 0
   THEN
      FOR I IN 1 .. l_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;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Error:' || SQLERRM);
END;

2 comments:

  1. Hi sridevi - I'm trying to re-activate the party_site, I do not see the party site use getting activated automatically. Have you ever tried re-activating an inactive party site use ???
    Thanks Much,
    Swathi

    ReplyDelete
  2. i am getting error by using above code This record in table hz_party_sites cannot be locked as it has been updated by another user.

    ReplyDelete