Problem with Form instances

Hi

I have a form which i clone to show it in an new window with an other instance and a new foundset. It is done with

solutionModel.cloneForm

Now wenn i am in that form i want to create a new record. I press the button and the onAction method is triggered. But I am not in the onAction Method of the form instance. I get to the onAction Method of the first form. What i have to do that i get to the onAction-Method of the form instance i am in.

Regards,
Stef

Hi Stef,

Can you please check that you might attached first form’s ‘onAction’ method for the button in the cloned form.
If you want to call your cloned form ‘onAction’ method, you can create a new run time method and attach that to the button in form instance.
Below is the sample code(assuming your form instance is ‘jsForm’)

var jsMethod = jsForm.newMethod('function onActionClonedForm() { ' +
										'plugins.dialogs.showInfoDialog("Info","Method triggered from cloned form","OK");' +
									'}');
var jsBtn = jsForm.getButton('<name_of_the_button_which_you_want_to_attach_onAction_method>')
jsBtn.onAction = jsMethod;

.

Hope this helps…:)

Thanks,
pb.

More clone tips: viewtopic.php?f=2&t=15050