Remove ability to insert new row on condition

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:21 AM
When the "Status" is submitted, I need to take away the ability to "Insert new row..." on a related list:
The only time a user should be able to insert a new row would be if the status is NOT submitted.
I tried doing it by manipulating the DOM:
function onLoad() {
document.onreadystatechange = function() {
if (document.readyState === 'complete')
{
if (g_form.getValue('u_status') == 'Submitted')
{
var e = document.getElementsByClassName('list_unsaved list_row list_add');
setTimeout(function(){ e[0].parentNode.removeChild(e[0]); }, 1000);
if (e.length)
e[0].parentNode.removeChild(e[0]);
}
}
};
}
Which worked, but 2 issues: 1) It's a bad way of doing it, and 2) if a user clicks a header of the related list to sort, then the "Insert a new row..." re-appears.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:52 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:54 AM
Yes, the related list is on the form, so I'm stumped too . I'm running Helsinki (latest patch)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:51 AM
I'm on Helsinki btw... don't know if "Omit insert row condition" is a Jakarta+ thing