# SolutionModel question

**URL:** <https://forum.servoy.com/t/solutionmodel-question/10205>\
**Category:** Classic Servoy\
**Created:** [January 29, 2009, 4:20pm UTC](https://forum.servoy.com/t/solutionmodel-question/10205 "2009-01-29T16:20:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![irenem](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@irenem](https://forum.servoy.com/u/irenem)\
**Post date:** [January 29, 2009, 4:20pm UTC](https://forum.servoy.com/t/solutionmodel-question/10205/1 "2009-01-29T16:20:22Z")

</div>

Hi,

I would like to add afield to an existing form, but nothing happens.

```auto
var myForm = solutionModel.getForm('calendar')
	myForm.newLabel('Country', 20, 86, 80, 20) 
	myForm.newTextField('field1', 140, 70, 141, 111)
	forms.calendar.controller.show()

```

Do I miss something? If I do the same on a new form it woks.

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [January 29, 2009, 4:26pm UTC](https://forum.servoy.com/t/solutionmodel-question/10205/2 "2009-01-29T16:26:34Z")

</div>

Hi Irene,

When you have an already loaded (or existing form) you need to ‘remove’ it from the model and the history like so:

```auto
// put the form in a variable
var myForm = solutionModel.getForm('calendar');

// remove the form from the solutionModel and history
history.removeForm('calendar');
solutionModel.removeForm('calendar');

// Change the form
myForm.newLabel('Country', 20, 86, 80, 20);
myForm.newTextField('field1', 140, 70, 141, 111);

// Now recreate the form again and show it
forms.calendar.controller.show()

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![irenem](https://avatars.discourse-cdn.com/v4/letter/i/977dab/32.png) [@irenem](https://forum.servoy.com/u/irenem)\
**Post date:** [January 29, 2009, 4:46pm UTC](https://forum.servoy.com/t/solutionmodel-question/10205/3 "2009-01-29T16:46:30Z")

</div>

Hi Robert,

I tried. To remove the history it’s enough. I don’t need to remove the form.  
I’m glad that I don’t have to rebuild the whole form each time.

Thanks for your help.
