strict warning: Only variables should be assigned by reference in /home/itechpros/ on line 1434.

Show a Detail Window Pop-Up from a List View Dynamically

This code allows you to show a Pop-Up Window from a list or table view you don't have to code a method for each "Show Detail Popup" button.

To use, either pass in the form to show as an argument, or even better, just name the button that gets clicked the same as the form name that you want to show! It will automatically load the correct record, and show the form in a window.

Note: Only works on tables with a single PK (no combo-keys) 


var formToShow = arguments[0]
    formToShow = application.getMethodTriggerElementName() 

var formName = application.getMethodTriggerFormName() 
var pk = databaseManager.getTable(forms[formName].controller.getServerName(),  forms[formName].controller.getTableName()).getRowIdentifierColumnNames()[0]
var pkValue = forms[formName].controller.getDataProviderValue(pk)