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:52 AM
I'm on Helsinki as well
Cheers
R0b0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 04:58 AM
Well, r0b0_d3vil, you've been more than helpful and responsive, and I truly appreciate it! It appears that I may need to open a HI ticket to find out why I'm not seeing this option.
In the meantime, can you link me official documentation on the "Omit insert row condition" field? I can't seem to locate it anywhere on the wiki or the new docs (https://docs.servicenow.com)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 05:02 AM
I did notice this in your post:
Yours says "Embedded" list control. Mine doesn't:
Maybe this?: Embedded List Control
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 05:08 AM
Hi David
To be honest with you i didn't change any ACL.
Simply added the list on the form and not as related list.
This will give you automatically the other form, the one you highlighted.
is it yours a related list ? I'm confused
Cheers
R0b0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 05:12 AM
Ahh.. ok, so on my form I am doing a "related list". That's the problem, I'm not "embedding" it. Now I just need to figure out how to bring in the related list without it being a "related list".. lol. ::scratches head::