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 05:17 AM
Yeah, strike that... I figured it out. It's early and on a Monday.... lol.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 05:19 AM
Hi David
Have a look to my example.
Supposing we want to add an embedded list here.
So usual right click on the form and modify the section.
In this case you need to look for the list. For instance i want to add 'Incident Alert'
After saving you have the embedded list
I hope this answer your question
Cheers
R0b0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 05:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 07:44 AM
There is a method used in ootb ui action conditions for related list... RP.isRelatedList .
Try to use the same in ACL.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 07:59 AM
1. Are you referencing UI Actions because you want me to look at example code there or you want me to do something with a UI Action?
2. I see some UI Actions with RP.isRelatedList() in the condition script, so how are you saying I should apply that to an ACL?