Update Journal Entry Field from Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 07:23 AM
I have created a client script to show or hide attachments based on if a user is in a list. This works great, I will share the code below.
However, the other requirement is for the journal entry to be update with a statement when a user is added to the list, and I am unsure how to make that happen. All attempts at this result in an infinite loop.
onChange Client Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
var user = g_user.userID;
var attach = g_form.getValue('u_add_attachment').toString();
var array = attach.split(',');
var isTrue = false;
g_form.showFieldMsg('u_add_attachment','I certify that I have reviewed my attachments and verified they do NOT contain UNNPI.','info');
for (var i=0; i < array.length; i++) {
//alert('reverence value is '+ array);
if(array[i].includes(user.toString())){
isTrue=true;
break;
}
}
if(isTrue==true){
g_form.enableAttachments();
}
else{
g_form.disableAttachments();
}
return;
}
}
Thanks,
Robbie
Labels:
- Labels:
-
Scripting and Coding
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 09:30 AM
You need to use GlideAjax from your client script to update journal field.
REgards,
Sachin