- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 08:07 AM
Hello, looking for help to fix this script to include if the ritm is assigned to the current user, enable attachments:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 08:16 AM - edited 06-20-2024 08:17 AM
Hi,
Try this
function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('approval') !== 'approved' && g_form.getDisplayBox('cat_item').value == 'Purchase Request' && g_form.getValue('assigned_to') != g_user.userID) {
g_form.disableAttachments();
}
}
Instead of going if - else -if , i have appended it in the same condition in IF that the current logged in user is not the assigned to + the other conditions, only the the attachments will be disabled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024 08:16 AM - edited 06-20-2024 08:17 AM
Hi,
Try this
function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getValue('approval') !== 'approved' && g_form.getDisplayBox('cat_item').value == 'Purchase Request' && g_form.getValue('assigned_to') != g_user.userID) {
g_form.disableAttachments();
}
}
Instead of going if - else -if , i have appended it in the same condition in IF that the current logged in user is not the assigned to + the other conditions, only the the attachments will be disabled.