How to access Work Notes value in Client Script
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 04:16 AM
Hi Team,
I want to access work notes in client script, but i am getting empty value.
var table_name = g_form.getTableName();
var rej_comm = "Cancellation/Closed Incomplete/Rejected Reason: ";
 var oldWorkNotes = g_form.getValue('work_notes');
 alert('old worknotes: '+oldWorkNotes);
 var oldComments = g_form.getValue('comments');
 alert('oldComment: '+oldComments);
 if (oldWorkNotes != '') {
 alert(oldWorkNotes);
 alert('oldWorknotes is empty');
 var assigneeWrkNotes = "Assignee Comment in brief: " + oldWorkNotes;
 g_form.setValue('work_notes', rej_comm + '\n' + assigneeWrkNotes);
 } else if (oldComments != '') {
 var addi_comments = "Additional Comments: " + oldComments;
 g_form.setValue('comments', rej_comm + '\n' + addi_comments);
 } else {
 alert('in else loop');
 g_form.setValue('work_notes', rej_comm);
 g_form.setValue('comments', rej_comm);
 }
 }
I am getting oldWorkNotes as empty, could you please help on this!!
Thanks in Advance!!!
 
					
				
		
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 04:27 AM
Hi Mounika,
Work note is a Journal field, it means it doesn't hold any value hence, you will get blank value on client side. To get value of worknotes, you need to make a glideajax call, and get its value from script include via. Further you can apply your rest of the logic.
You can get worknotes latest values using work_notes.getJournalEntry(-1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 04:28 AM
Hi,
Worknotes dont get saved in the same table , but rather on the journal tables.
So to read it id suggest
Write a display business rule and use the script below
g_scratchpad.oldWN= current.work_notes.getJournalEntry(1);
In your client script read it as
g_scratchpad.oldWN
-Anurag
