1 Reply Latest reply: Sep 24, 2012 10:19 AM by shreevat RSS

    How to create insert new Collections call notes into ar.ar_notes

    923106
      Hello,

      Could I have someone please point me in the right direction to look so I am able to enter new Collections Call notes into ar.ar_notes. I have built a new web app for our collections department, but they want the ability to enter their call notes from the app, instead going into Oracle to do it.

      I have found this (below), but I am not having any luck with it:

      BEGIN
      dbms_application_info.set_client_info(235);
      END;

      Declare
      l_notes_detail CLOB;
      l_note_type VARCHAR(30) := 'IEX_HIST'; -- Any note type as required
      l_note_status VARCHAR2 (1) := 'I'; -- I is for insert.
      l_return_status VARCHAR2 (1);
      l_msg_count NUMBER;
      l_msg_data VARCHAR2 (2000) := 'THIS IS A TEST';
      l_note_id NUMBER ;
      l_msg_index_out NUMBER;
      BEGIN
      jtf_notes_pub.create_note
      (p_api_version => 1.0,
      p_init_msg_list => 'T',
      p_commit => 'T',
      p_jtf_note_id => NULL,
      p_validation_level => 100,
      p_source_object_id => '126754', -- Pass cust_acct_id to migrate account level notes or Site Use ID for migrating notes at Bill - To.
      p_source_object_code => 'IEX_ACCOUNT',
      p_notes => 'CLOB Notes', --note_rec.note_text, (upto 2 gig note text)
      p_notes_detail => 'Details', --l_notes_detail, (2000 char text)
      p_entered_by => '1200', --note_rec.created_by,
      p_entered_date => sysdate, --note_rec.creation_date,
      p_last_update_date => sysdate, --note_rec.last_update_date,
      p_last_updated_by => '1200', --note_rec.last_updated_by,
      p_creation_date => sysdate, --note_rec.creation_date,
      p_created_by => '1200', --note_rec.created_by,
      p_last_update_login => '1',--fnd_global.login_id,
      p_note_type => 'CALL', --l_note_type,
      p_note_status => 'I', --l_note_status,
      x_jtf_note_id => l_note_id,
      x_return_status => l_return_status,
      x_msg_count => l_msg_count,
      x_msg_data => l_msg_data
      );
      IF (l_return_status <> 'S')
      THEN
      fnd_file.put_line(fnd_file.LOG,'l_return_status <> S ');
      IF (fnd_msg_pub.count_msg > 0)
      THEN
      FOR i IN 1 .. fnd_msg_pub.count_msg
      LOOP
      fnd_msg_pub.get
      (p_msg_index => i,
      p_encoded => 'F',
      p_data => l_msg_data,
      p_msg_index_out => l_msg_index_out
      );
      DBMS_OUTPUT.put_line ('Error:' || l_msg_data);
      fnd_file.put_line(fnd_file.LOG,'ERROR :' || l_msg_data);
      END LOOP;
      END IF;
      END IF;
      COMMIT;
      END;

      Thank you,

      -eric