# application.getMethodTriggerFormTableName()?

**URL:** <https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043>\
**Category:** Classic Servoy\
**Created:** [November 11, 2004, 4:52pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043 "2004-11-11T16:52:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drookwood](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@drookwood](https://forum.servoy.com/u/drookwood)\
**Post date:** [November 11, 2004, 4:52pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043/1 "2004-11-11T16:52:05Z")

</div>

It would be really useful to be able to get the tablename of the form that triggered a method. Wherever possible I like to use global methods that are for shared use by a number of forms based on the same table and I have a number of global ‘action’ methods that do a similar job for a number of forms that use a variety of tables - I need to be able to direct the action method to the correct global method which is based on the tablename of the form that triggered the action method using an eval statement. Does this make sense to anyone? ![:?]( "Confused")

Since it is already possible to get the triggering formname I assume it would not be hard to get the relevant tablename as well.

---

<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:** [November 11, 2004, 5:26pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043/2 "2004-11-11T17:26:15Z")

</div>

How about ```  
forms[application.getMethodTriggerFormName].controller.getTableName

```auto

By heart btw so beware of the format
```

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [November 11, 2004, 5:27pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043/3 "2004-11-11T17:27:46Z")

</div>

Hi David,

There is already a getTableName function under both controller and currentcontroller.

You have probably just overlooked it.

Cheers  
Harry

---

<div class="post-metadata">

**Author:** ![drookwood](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@drookwood](https://forum.servoy.com/u/drookwood)\
**Post date:** [November 12, 2004, 11:19am UTC](https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043/4 "2004-11-12T11:19:23Z")

</div>

Harry - I was aware of these options but this doesn’t work when a method is triggered from a tab panel which is showing records from a table other than the main controller as it will return the table for the main record controller rather than the table for the records showing on the tab panel.

Marcel - you’ve cracked it - thanks ![:D]( "Very Happy") Just needed to add the ‘()’

```auto
forms[application.getMethodTriggerFormName()].controller.getTableName()

```

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [November 12, 2004, 4:52pm UTC](https://forum.servoy.com/t/application-getmethodtriggerformtablename/3043/5 "2004-11-12T16:52:28Z")

</div>

Ah, I did mean it to be used the way Marcel suggested, I just wasn’t thorough enough in my answer !!

Harry
