Interacting with an HxGN EAM screen/tab via your HxGN EAM Extensibility JavaScript - HxGN EAM - Version 11.07.01 - Feature Briefs - Hexagon

HxGN EAM Extensibility Framework

Language
English
Product
HxGN EAM
Search by Category
Feature Briefs
HxGN EAM Version
11.7.1

This is a brief primer on the following functionality which is exposed and officially supported via an HxGN EAM Extensibility Framework JavaScript:

  • blur: Field specific event that fires anytime you tab into and out of a form field.

  • before_eam_customonblur: Field specific event that fires anytime you tab into and out of a form field and some specific HxGN EAM business logic checks pass. This event fires before the form specific HxGN EAM code executes.

  • Customonblur: Field specific event that fires anytime you tab into and out of a form field and some specific HxGN EAM business logic checks pass. This event fires after the form specific HxGN EAM code executes.

  • before_eam_beforenewrecord: Toolbar specific event (tab and main toolbar) that fires when you click the New Record toolbar icon. This event fires before the form specific HxGN EAM code executes.

  • Beforenewrecord: Toolbar specific event (tab and main toolbar) that fires when you click the New Record toolbar icon. This event fires after the form specific HxGN EAM code executes.

  • before_eam_afternewrecord: Toolbar specific event (tab and main toolbar) that fires when you click the New Record toolbar icon. This event fires before the form specific HxGN EAM code executes.

  • Afternewrecord: Toolbar specific event (tab and main toolbar) that fires when you click the New Record toolbar icon. This event fires after the form specific HxGN EAM code executes.

  • before_eam_beforesaverecord: Toolbar specific event (tab and main toolbar) that fires when you click the Save Record toolbar icon. This event fires before the form specific HxGN EAM code executes.

  • Beforesaverecord: Toolbar specific event (tab and main toolbar) that fires when you click the Save Record toolbar icon. This event fires after the form specific HxGN EAM code executes.

  • before_eam_aftersaverecord: Toolbar specific event (tab and main toolbar) that fires when you click the Save Record toolbar icon. This event fires before the form specific HxGN EAM code executes.

  • Aftersaverecord: Toolbar specific event (tab and main toolbar) that fires when you click the Save Record toolbar icon. This event fires after the form specific HxGN EAM code executes.

  • before_eam_beforedestroyrecord: Toolbar specific event (tab and main toolbar) that fires when you click the Delete Record toolbar icon. This event fires before the form specific HxGN EAM code executes.

  • Beforedestroyrecord: Toolbar specific event (tab and main toolbar) that fires when you click the Delete Record toolbar icon. This event fires after the form specific HxGN EAM code executes.

  • before_eam_afterdestroyrecord: Toolbar specific event (tab and main toolbar) that fires when you click the Delete Record toolbar icon. This event fires before the form specific HxGN EAM code executes.

  • Afterdestroyrecord: Toolbar specific event (tab and main toolbar) that fires when you click the Delete Record toolbar icon. This event fires after the form specific HxGN EAM code executes.

In HxGN EAM 11.0 onwards there is flexibility that allows you to write specific business logic before/after certain toolbar actions.

For example, a 'beforenewrecord' event fires before the HxGN EAM specific business logic for a New Record action occurs and allows you to prevent the New Record HxGN EAM business logic from executing (thus the 'afternewrecord' event will not fire and the record state itself won't change). Same concept applies for all toolbar button action events. The 'afternewrecord' event fires after HxGN EAM business logic runs for a New Record action, allowing you to do some follow up action after all the HxGN EAM business logic has executed. The same concept applies for all toolbar button action events.

Here is an example:

Ext.define('EAM.custom.external_wscrew', {

extend: 'EAM.custom.AbstractExtensibilityFramework',

getSelectors: function() {

return {

'[ExtensibilityFramework] [tabName=HDR][isTabView=true] [name=organization]': {

before_eam_customonblur: function() {

// This code executes before the form specific organization change code executes

// return false in this method to prevent the actual form specific code from executing

},

customonblur: function() {

// This code executes after the form specific organization change cod executes

// Do some follow up processing

}

},

'[ExtensibilityFramework] [tabName=HDR][isTabView=true]': {

before_eam_beforesaverecord: function() {

// This code executes before the form specific 'beforesaverecord' checks run

// return false in this method to prevent the actual form specific code from executing

},

beforesaverecord: function() {

// This code executes after the form specific 'beforesaverecord' checks run

// return false in this method to prevent the actual save from occurring

},

before_eam_aftersaverecord: function() {

// This code executes before the form specific 'aftersaverecord' follow up code runs

// return false to prevent the actual form specific code from executing

},

aftersaverecord: function() {

// This code executes after the form specific 'aftersaverecord' follow up code runs

}

},

// Web Service Prompt tab

'[ExtensibilityFramework] [tabName=Y1][isTabView=true][userFunction=WSCREW]': {

// do stuff

}

}

}

});

You can read the ExtJS documentation about what selectors are and how ExtJS uses them.

When you write your selector, it must follow these conventions:

  • The selector must always contain [ExtensibilityFramework] in the String, otherwise your code will never execute, or you'll mess up the form specific HxGN EAM code.

  • The selector must always contain [tabName=<tab_name>][isTabView=true] in the String, otherwise your code will never execute for the tab you are on (if you don't put the isTabView=true flag on the selector your code will fire twice). The three-letter tab name must be all uppercase.

  • For Web Service Prompt / User Defined Screens (main stand alone / record view screens or tab screens) the selector must contain [userFunction=<user_function_name>]. If you do not do this, your custom code will cause issues with the rest of the EAM screens.

  • The selector must contain [name=<field_name>] for field specific business functionality to execute properly. This part of the selector is not required for toolbar actions.

Finally, the last step to exposing your Extensibility Framework JavaScript to HxGN EAM is to check the Active checkbox and then navigate to your desired screen. The custom JavaScript will execute.