Event

Use an Event extension type to code additional logic around a session’s standard events.

This is supported for these events:

  • Before Program
  • After Program
  • After Form Read
  • Before Display Object
  • Before New Object, sessions of type ‘maintain’ only
  • After Update DB Commit, sessions of type ‘maintain’ only

Event examples:

  • To synchronize with a secondary table.
  • To hide groups, fields, commands, total line, etc.

This table shows the available hooks:

Name Signature
Before Program void before.program()
After Program void after.program()
After Form Read void after.form.read()
Before Display Object void before.display.object()
Before New Object void before.new.object()
After Update DB Commit void after.update.db.commit()

For more information about those hooks, see the Infor ES Programmers Guide (Infor Customer Portal KB2924522).

If the standard hook must be executed before the extension hook is executed, you can force the standard hook to execute anytime you prefer. This can be achieved by calling the event.super() function.

Examples:

function extern void before.program()
{
|* Don’t display a total line in the session

        event.super()
        fattr.total.line = false
        change.done.in.session = false
}

function extern void after.program()
{
|* Build file with pricebooks when changes have been done during
|* this session. Flag has been set in after.update.db.commit hook.

        if change.done.in.session then
                txpcgdll0001.build.pricebook.file()
        endif
 }

function extern void after.read.form()
{
|* Remove the link to the DOM data 

        remove.form.commands("document.output.man")
 }

function extern void before.display.object()
{
|* Handle disabling/enabling custom fields

        if ext.print.detail = tcyesno.no then
                disable.fields("ext.print.comp", "ext.print.mat")
        else
                enable.fields("ext.print.comp", "ext.print.mat")
        endif
}

function extern void before.new.object()
{
|* Make a new description during copy

        if choice = dupl.occur then
                tcmcs045.dsca = strip$(tcmcs045.dsca) & " (copy)"
        endif 
}

function extern void after.update.db.commit()
{
|* Set the flag so that the after.program hook publishes the pricebook
 
       change.done.in.session = true
}