# FORM INHERITANCE

**URL:** <https://forum.servoy.com/t/form-inheritance/20672>\
**Category:** Questions\
**Created:** [January 25, 2022, 9:17pm UTC](https://forum.servoy.com/t/form-inheritance/20672 "2022-01-25T21:17:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlclark](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@dlclark](https://forum.servoy.com/u/dlclark)\
**Post date:** [January 25, 2022, 9:17pm UTC](https://forum.servoy.com/t/form-inheritance/20672/1 "2022-01-25T21:17:14Z")

</div>

Currently working on using Form Inheritance to reduce code complexity in existing application for our Sailing Magazine as a part of eliminating DEPRECATED METHODS, in this case in regards to the use of [//application.showFormInDialog](https://application.showFormInDialog)(forms.frm\_web\_resources,-1,-1,-1,-1,‘Resource on Web’,false,false,‘’,false )

I created a new form: baseModalDialog.frm and created a creation method:

/\*\*

- public
- @param {JSRecord | JSFoundSet} requestedFoundset
- @param {String} windowTitle
- @properties={typeid:24,uuid:“EDAE4C99-CF9A-481E-9F98-3E2E24016683”}  
\*/  
function openModal(requestedFoundset, windowTitle ) {  
// ABSTRACT FORM

if(requestedFoundset) {

foundset: requestedFoundset ;  
}  
// OPEN MODAL

var win = application.createWindow( controller.getName(), JSWindow.MODAL\_DIALOG);  
win.title = windowTitle;

win.show(this);

// Note: Execution halts here until after return from modal dialog

win.hide();

}

Then set forms.frm\_web\_resources to be extended from the new form. This all seems to look good.  
But when I create a reference this from another form. The method openModal() does not CODE COMPLETE.

I can only get it to CODE COMPLETE, by creating a method in the CHILD FORM and calling \_super.openModal( foundset, windowTItle) from it. That seems to make inheritance useless.

Any ideas - perhaps I have not done something that is required to make this work properly.

Daryl()

---

<div class="post-metadata">

**Author:** ![dlclark](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@dlclark](https://forum.servoy.com/u/dlclark)\
**Post date:** [January 25, 2022, 9:44pm UTC](https://forum.servoy.com/t/form-inheritance/20672/2 "2022-01-25T21:44:34Z")

</div>

Now that is ODD, not sure what changed, but it started working when I added another FORM and set its inheritance to baseModalDialog …
