HOW TO create JTF_NOTES

API to create JTF_NOTES

JTF_NOTES_B

JTF_NOTES_B stores all non–translated information about Notes. Notes may be created for any object mapped for object usage in JTF_OBJECTS; the JTF_OBJECT that the note is linked to is stored as the source_object_code and source_object_id. The actual text of the note, which is stored in the JTF_NOTES_TL, is split into two parts under columns NOTES and NOTE_DETAILS. Typically, the NOTES should hold the short form or the first part of the note. NOTE_DETAILS for added details, or whenever the note is longer than the 2000 character limit for the NOTES column. The NOTE_STATUS flags the note as being personal (P), Internal (I), or Publish(E).
 

DECLARE
   x_return_status   varchar2 (1);
   x_msg_count       number;
   x_msg_data        varchar2 (200);
   x_jtf_note_id     number;
   x_msg_index_out   number;
BEGIN
   DBMS_APPLICATION_INFO.set_client_info (ORG_ID);
   fnd_global.apps_initialize (USER_ID, RESP_ID, APPL_ID);

   jtf_notes_pub.create_note (p_api_version          => 1.0,
                              x_return_status        => x_return_status,
                              x_msg_count            => x_msg_count,
                              x_msg_data             => x_msg_data,
                              p_source_object_id     => 999999999, -- INSTANCE_ID
                              p_source_object_code   => 'CP', --Customer Product
                              p_notes                => 'Customer Note',
                              p_notes_detail         => NULL,
                              p_note_status          => 'I',
                              x_jtf_note_id          => x_jtf_note_id,
                              p_last_update_date     => SYSDATE,
                              p_last_updated_by      => fnd_global.user_id,
                              p_creation_date        => SYSDATE,
                              p_created_by           => fnd_global.user_id,
                              p_note_type            => 'ASF_CONVERSATION');
   IF x_return_status = Fnd_Api.G_RET_STS_SUCCESS
   THEN
      DBMS_OUTPUT.put_line (
         'Note has been created with Note Id:' || x_jtf_note_id
      );
   ELSE
      FOR j IN 1 .. x_msg_count
      LOOP
         x_msg_data := NULL;
         fnd_msg_pub.get (j,
                          FND_API.G_FALSE,
                          x_msg_data,
                          x_msg_index_out);

         FND_FILE.PUT_LINE (
            FND_FILE.LOG,
            'Error at Created Acct Relationship. ' || x_msg_data
         );
         DBMS_OUTPUT.put_line (x_msg_data);
      END LOOP;
   END IF;
END;
/

Comments

Popular posts from this blog

HOW TO auto approve workflow WF notification procedure

HOW TO register table in oracle apps

HOW TO update an existing user in oracle apps