Tuesday, November 27, 2018

Prevent users from adding, changing, or removing sublist line items

In order to prevent users from adding, editing, inserting, or deleting line items from a sublist, a client script needs to be created that will subscribe to the following events:

validateLine(type)
validateInsert(type)    
validateDelete(type) 

Each of the client events mentioned above return a Boolean to indicate if the operation proceeds or not.  For instance, if the validateLine() function returns true, then a new line item is added to the sublist.  If false, then the add operation cannot proceed.

The following code illustrates this concept:

// validateLine
function validateLine(type)
{
    alert('validateLine: cannot edit the current line or add a new line');
    return false;
}

// validateInsert
function validateInsert(type)
{
    alert('validateInsert: cannot insert a new line');
    return false;
}

// validateDelete
function validateDelete(type)
{
    alert('validateDelete: cannot delete any line items');
    return false;
}

No comments:

Post a Comment