application.getMethodTriggerFormTableName()?

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? :?

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

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


By heart btw so beware of the format

Hi David,

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

You have probably just overlooked it.

Cheers
Harry

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 Just needed to add the ‘()’

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

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

Harry