# application.getMethodTriggerFormName() not returning correct

**URL:** <https://forum.servoy.com/t/application-getmethodtriggerformname-not-returning-correct/8700>\
**Category:** Classic Servoy\
**Created:** [February 5, 2008, 2:19pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformname-not-returning-correct/8700 "2008-02-05T14:19:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [February 5, 2008, 2:19pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformname-not-returning-correct/8700/1 "2008-02-05T14:19:19Z")

</div>

I have the following test solution setup to demonstrate…

A global method called _globals.testGlobal()_  
Two forms, one called _test\_form\_1_ and another called _test\_form\_2_.

On _test\_form\_1_ I have a method called _testMethodForm1()_ that contains the following code…

```auto
forms.test_form_2.testForm2Method();

```

And on _test\_form\_2_ I have the above mentioned method _testFrom2Method()_ which contains the following…

```auto
globals.testGlobal();

```

Inside 'globals.testGlobal()[/i] I have the following…

```auto
xx = application.getMethodTriggerFormName();
application.output(xx);

```

Now if I attach _testMethodForm1()_ to a buttons onAction on _test\_form\_1_ the output from application.getMethodTriggerFormName()[/i] in _globals.testGlobal()_ will return _test\_form\_1_, rather than _test\_form\_2_ which from the documentation I understand it should return as that is the form that called the global method.

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [February 5, 2008, 2:23pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformname-not-returning-correct/8700/2 "2008-02-05T14:23:47Z")

</div>

hmm, are you sure that this```  
forms.test\_form\_2.testForm2Method();

```really

```

---

<div class="post-metadata">

**Author:** ![ryanparrish](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@ryanparrish](https://forum.servoy.com/u/ryanparrish)\
**Post date:** [February 5, 2008, 2:29pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformname-not-returning-correct/8700/3 "2008-02-05T14:29:33Z")

</div>

Ahh…Yes, of course. I guess I am in fact calling the method from ‘test\_form\_1’, the method just happens to reside on ‘test\_form\_2’. ![:oops:]( "Embarassed")
