It’s not recommended to modify extension pages because you can have problems when upgrading to a new version (your changes need to be merged with the changes from the new version). If there’s no other way then you should keep the changes to a minimum. So your approach was not the best. A better solution would be to:
- change the class sheet binding of Diagram.DiagramClass (from object editor) to point to your custom sheet. And that’s the only change you make to the Diagram Application.
- include Diagram.DiagramSheet in your custom sheet (using the include macro)
- for the rest of your custom sheet:
-
call $doc.getObject(‘…’, true) with a second parameter that ensures the object is created if it doesn’t exist. This way you avoid modifying the diagram template. And if you need some default values just set them before displaying the fields
-
use a hidden input to set the object policy to “updateOrCreate” in order to save your custom data along with the diagram data
<input type="hidden" name="objectPolicy" value="updateOrCreate" />
-
Hope this helps,
Marius