Joseph_An
8 years agoCreator II
How to block inserting new row in affected item in DCO?
Hi expert,
Once the state of DCO is changed from "New" to other state,
I try for a user not to allow to insert an item in affected item in DCO.
So, I added the javascript codes below in Grid Event 'OnInsertRow':
--------------------------------------------------------------------------------------------------
var stat = parent.thisItem.getProperty("state", "");
if (stat === "New" || stat.length === 0 ) {
return true;
} else {
alert("You cannot add or remove a document from the DCO once submitted.");
return false; // prohibit the action
}
--------------------------------------------------------------------------------------------------
However, even if I put 'return false', once system show alert message,
system insert new empty line in affected item which I don't expect.
My expectation is if 'return false', system don't insert new row.
Would you help me how to do it?
Thank you so much.