Transfer comments and work notes to new record

JJG
Kilo Guru

Hello,

I have a UI action that transfers field values from a record to a new record in another table. I would like to transfer the comments and work notes to the new record but it does not seem to be working (See pics below)

Before

find_real_file.png

After

find_real_file.png

UI Action:

 var gr = new GlideRecord('x_utsll_candidate_candidate_outreach');

gr.comments_and_work_notes = current.comments_and_work_notes;

gr.insert();

 

I have used this code to transfer other field values and it works, just not for the comments_and_work_notes field.

1 ACCEPTED SOLUTION

JJG
Kilo Guru

gr.work_notes = current.work_notes.getJournalEntry(-1); 

This worked ^

View solution in original post

6 REPLIES 6

Munender Singh
Mega Sage

Hi,

 

Kindly use the following line in your code to copy the work notes

gr.comments_and_work_notes= current.comments_and_work_notes.getJournalEntry(1);

 

Regards,

Munender

 

 

unfortunately, that does not seem to work either.

Sukraj Raikhraj
Kilo Sage

comments and work notes get logged to Sys Journal table. you will have to query that table, try looking at that table for more ideas...

Prateek kumar
Mega Sage

try 

var gr = new GlideRecord('x_utsll_candidate_candidate_outreach');
gr.initialize();

gr.comments_and_work_notes = current.comments_and_work_notes;

gr.insert();


Please mark my response as correct and helpful if it helped solved your question.
-Thanks