AnsweredAssumed Answered

Chicken and Egg? I need to find the name of the current table, but do not have an active field

Question asked by MikeBradshaw on Apr 23, 2012
Latest reply on Apr 24, 2012 by MikeBradshaw

Title

Chicken and Egg? I need to find the name of the current table, but do not have an active field

Post

Hi,

I have searched for the whole day looking for a way to solve this and each time I find a part solution. It seems I may have a chicken and egg problem, but I am sure someone smarter than me has already figured this one.

I have setup a 'join' table called DOCUSAGE as a means of determining how a single instance of a Document is used within the database. For example, a Product tech worksheet may have been emailed to a Contact working on a Project. In this instance the single record holds the link to the Document ID, Product ID, Contact ID and Project ID. If the record from the Join table is deleted then all the links have gone, therefore I want to be able to check whether the record in the Join table links to other tables before deleting and providing the user a warning with the option to cancel, delete or edit the record to remove a specific link (hopefully this still makes sense).

I have it working fine IF I create a separate script for every table, however I was hoping there was a way to create a single script that identified the table whcih could then be usedin the Go to Related Record.....function.

I have tried using Get(ActiveFieldTableName) however I need to click in a field before this work (once I click in a field it does work, but the user just wants to press the X Delete button, and the button doesn't seem to count even though it is on the portal row. I have looked at making a field Active but to do this you need to have the Table name, therefore I am in the catch 22 situation.

Any ideas would be greatly appreciated.

Mike

Outcomes