Hello,
An easier solution than disabling the new button would be to add an onBeforeNew Client Event to the relationship's ItemType with code similar to the sample below.
var parState = parent.thisItem.getProperty("state");
if (parState === "YOUR_STATE") {
aras.AlertError("Cannot add Document File while parent is in " + parState + " state.");
return false;
}
Please note that while this Client Event will block a user from adding items through the web client, it will not prevent additional relationships from being added directly through AML. To prevent this, it would be best to also add an onBeforeAdd Server Event with similar C# or VB code.
Chris
________________________________
Christopher Gillis
Aras Labs Software Engineer