Get the Table's name that triggered a Post-Write Event

SOLVED

Hello,

We have a custom-defined script that triggers Post-Write on the table CI_Item. This script then reads the field 'ItemCode' of that table.
We also want to extend this by triggering this script with other tables. 

I am seeking a way to retrieve the table's name that triggered the event. Depending on the table's name, I'll retrieve a specific column. The remaining script will be unchanged.

How do I retrieve the table's name from oScript, oBusObj, or whatever variable exposes that data?

I looked here but didn't find any function that answers my needs.

Cheers,

Imad

Parents
  • +1
    verified answer

    Greetings,

    You should be able to use oBusObj.sGetTable("MAIN") to return the table name for the main data source of the business object.  Many business objects use multiple tables so you can use the oBusObj.sGetDataSources() to return a list of all the data sources (tables) used by the object.  The first table in the list should be "MAIN" which is always the main table.

    Kent

Reply
  • +1
    verified answer

    Greetings,

    You should be able to use oBusObj.sGetTable("MAIN") to return the table name for the main data source of the business object.  Many business objects use multiple tables so you can use the oBusObj.sGetDataSources() to return a list of all the data sources (tables) used by the object.  The first table in the list should be "MAIN" which is always the main table.

    Kent

Children