eForm Events

The table in this topic give the list of eForm events you can use in JavaScript.

Examples

  • (Example) Use Custom JavaScript in an eForm
  • JavaScript Methods for eForm Builder - Examples for JavaScript methods that are available out-of-the-box (OOTB) in AgilePoint NX.
  • REST API - Code examples for implementing the REST API.
  • Advanced Examples

    For more advanced or complex examples or specific information about how to solve a specific business problem or use case, AgilePoint recommends the following resources:

    • AgilePoint Community Forums - A free, AgilePoint-moderated, crowd-sourcing user forum where you can ask questions about specific techniques, the solutions to use cases, workarounds, or other topics that may not be covered in the Product Documentation.
    • Video Portal - Video walkthroughs for a range of simple and advanced tasks in AgilePoint NX.
    • Professional Services - If you can not find the information you need for your specific business problem, mentoring is available through AgilePoint Professional Services.
    • Personalized Training - AgilePoint can provide personalized training for your organization. To request personalized training, contact AgilePoint Sales.

Good to Know

  • The class eFormEvents contains these events. You can call a JavaScript method as eFormEvents.[eventname].

    Example:

    eFormEvents.onFormLoadComplete

Events

Event Description

onAllFilesFetch

Function:
Occurs when all JavaScript files are loaded.
Example:
eFormEvents.SharedJS.onAllFilesFetch = function(eventArgs)
{
  // Functionality goes here
                                        
  // eventArgs – will contain list of JavaScript files. Each object will contain filename and its status.
  // eventArgs[0].fileName - Gives the JavaScript filename 
  // eventArgs[0].status - Gives the status of the JavaScript file
}
Limitations:

AgilePoint NX OnDemand (public cloud), or AgilePoint NX Private Cloud or AgilePoint NX OnPremises v7.0 Software Update 1 or higher

onBeforeExportAsCSV

Function:
Occurs before export data as a CSV file in a subform.

This event supports for both Subform (Legacy) form control and Subform form control.

Example:
eFormEvents.subForm.onBeforeExportAsCSV = function (eventArgs, callback) { 
  //Functionality goes here
  eventArgs.fieldId // The internal name of the subform
  eventArgs.fieldPath // The field path of the subform
  eventArgs.fileName // The filename (label/dataname)
  callback(newFileName); // This callback is required to export the file in CSV format. 
                         // If it is not called, the file will be exported.
}
Limitations:

onBeforeSubmit

Function:
Occurs after a Before Submit rule is executed, and before the validation of the form controls and form sections.
Example:
eFormEvents.onBeforeSubmit = function (callback) 
{
  // Functionality goes here

  // This callback is mandatory for the form submission. 
  //  If it is not called, the form won't get submitted.
  callback (true);  
}

onEditRecord

Function:
Occurs when you change a record in a Subform form control if the Display Style field is set to Summary Columns.
Example:
eFormEvents.subForm.onEditRecord = function (eventArgs) { 
  //Functionality goes here
  eventArgs.fieldId  // The internal name of the subform
  eventArgs.fieldPath  // The field path of the subform
  eventArgs.data // The updated row data
}
Limitations:

onFileFetch

Function:
Occurs each time a JavaScript file loads.
Example:
eFormEvents.SharedJS.onFileFetch = function(eventArgs) 
{
  // Functionality goes here
                                        
  // eventArgs.fileName - Gives the JavaScript filename 
  // eventArgs.status - Gives the status of the JavaScript file
}
Limitations:

AgilePoint NX OnDemand (public cloud), or AgilePoint NX Private Cloud or AgilePoint NX OnPremises v7.0 Software Update 1 or higher

onFormLoadComplete

Function:
Occurs when the form load is complete.
Example:
eFormEvents.onFormLoadComplete = function () 
{
     // Functionality goes here

}

onSectionNavigation

Function:
Occurs when all the form controls for the specified section is loaded.
Example:
eFormEvents.onSectionNavigation = function (eventArgs) 
{
  // Functionality goes here
  
  // eventArgs.currentSection - will give the current 
  // section's header
  
  // eventArgs.previousSection -  will give the previous section's 
  // header from where it got navigated.
}

onSubmit

Function:
Occurs after the form data is submitted.
Example:
eFormEvents.onSubmit = function () 
{
  // Functionality goes here
}

onValidationOnSubmit

Function:
Occurs after a Validation on Submit rule is executed, and before the form data is submitted.
Example:
eFormEvents.onValidationOnSubmit = function (callback) 
{
  // Functionality goes here

  // This callback is mandatory for the form submission. 
  // If it is not called, the form won’t get submitted.
  callback (true);  
}

onAddRecord

Function:
Occurs after a row is added in a subform.
Example:
eFormEvents.subForm.onAddRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the subform element
  // eventArgs.dataName - Gives the internal name of the subform
  // eventArgs.newRow - Gives the row element

}

onDeleteRecord

Function:
Occurs after a row is deleted from a subform.
Example:
eFormEvents.subForm.onDeleteRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the subform element
  // eventArgs.dataName - Gives the internal name of the subform
}

onCopyRecord

Function:
Occurs after a row is copied to a subform.
Example:
eFormEvents.subForm.onCopyRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the subform element
  // eventArgs.dataName - Gives the internal name of the subform
  // eventArgs.newRow - Gives the row element
}

onAddRecord

Function:
Occurs after a row is added in a Data Grid form control.
Example:
eFormEvents.grid.onAddRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the grid element
  // eventArgs.dataName - Gives the internal name of the grid
  // eventArgs.newRow - Gives the row element
  // eventArgs.rowData - Gives the JSON data for the newly added row

}

onDeleteRecord

Function:
Occurs after a row is deleted from a Data Grid form control.
Example:
eFormEvents.grid.onDeleteRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the grid element
  // eventArgs.dataName - Gives the internal name of the grid
  // eventArgs.rowData - Gives the JSON data for the newly added row
}

onCancelRecord

Function:
Occurs after a row change is cancelled in a Data Grid form control.
Example:
eFormEvents.grid.onCancelRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the grid element
  // eventArgs.dataName - Gives the internal name of the grid
  // eventArgs.cancelledRow - Gives the row element
  // eventArgs.rowData - Gives the JSON data for the newly added row
}

onSaveRecord

Function:
Occurs after a row is changed and then saved in a Data Grid form control.
Example:
eFormEvents.grid.onSaveRecord = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.element - Gives the grid element
  // eventArgs.dataName - Gives the internal name of the grid
  // eventArgs.savedRow - Gives the row element
  // eventArgs.rowData - Gives the JSON data for the newly added row
}

onDataBound

Function:
Occurs after a Data Grid form control binds data from a data source.
Example:
eFormEvents.grid.onDataBound = function (eventArgs) 
{
  // Functionality goes here
  // eventArgs.dataName - Specifies the internal name of the Data Grid
  // eventArgs.kendoInstance - Specifies the Telerik instance
}
Limitations:

AgilePoint NX OnDemand (public cloud), or AgilePoint NX Private Cloud or AgilePoint NX OnPremises v7.0 Software Update 2 or higher

onPostUpload

Function:
Occurs after a file is uploaded to repository with the File Upload form control.
Example:
eFormEvents.FileUpload.onPostUpload = function (response) { 
  // Functionality goes here
  // After the file is uploaded to the repository
  // Response object holds uploaded file details 
  // For example: filename, fileId, url, size, uploadedBy, itemId, and encodedURL
};
Limitations:

onPreUpload

Function:
Occurs before the File Upload form control starts to upload the file.
Example:
eFormEvents.FileUpload.onPreUpload = function (data, callback) { 
  // Functionality goes here
  // The data object holds control and file details
  // The structure of the data parameter
  fileInfo: {
  fileName,
  fileSize,
  fileType
  },
    controlInfo: {
    xPath,
    internalName
    }
  var modifiedData = {
  canUpload: true, // User can specify whether file can be uploaded or not
  newFileName: "NewName" + new Date().getTime() + "." + data.fileInfo.fileType, // New file name
  validationMessage: "User Defined Validation Message!" // Custom validation message to display 
                                                        // If the user sends canUpload as false
  };
  callback(modifiedData);
}
Limitations:

printForm

Function:
Occurs when a form user clicks the Print button.
Example:
var options = {}
options.width = '800px';
eFormEvents.printForm = function(callback)
{
  // Functionality goes here
  // This callback is mandatory for the print form functionality. 
  // If it is not called, the form won't get printed.
  callback(options);
}
Limitations:

AgilePoint NX OnDemand (public cloud), or AgilePoint NX Private Cloud or AgilePoint NX OnPremises v7.0 Software Update 1 or higher