Skip to main content
Skip table of contents

Launching NexJ CRM dialogs from third-party applications

The NexJUtils.openNexJPopup JavaScript function can be used to launch NexJ CRM dialogs from third-party applications.

openNexJPopup function description

Opens a NexJ CRM dialog window in a third-party application. For example, you can use this function to create a new NexJ CRM task or display a NexJ CRM report while working in a different application.

Method signature

JS
function NexJUtils.openNexJPopup(sScreenName, sScreenAlias, bNewWindow, paramObj)

API parameters

ParameterValueDescription
sScreenNameString

The screen to be opened in the dialog window. 

Currently, the valid values for this parameter are:

  • "mda:TaskCreate"
  • "mda:DocumentCreate"
  • "mda:ScheduleItemCreate"
  • "ReportBriefing"
  • "ReportEntity"


The list of supported screen names can be found in the NexJUtils file.

The NXJ_SCREEN_INFO_MAP variable holds a mapping between the dialog name and the value expected in the GenericProperties.portlet to launch the dialog.

sScreenAliasString

The base screen alias to use for a particular dialog. It should be the same for all dialogs of the same type.

Example: cwActionNote

bNewWindowBoolean

Specify whether opening a dialog should launch in a new window or re-use the last opened dialog window of the same type, if any.

Specify true. Opening multiple new windows is not currently supported; only a single dialog window can be opened for a given user at one time for the same dialog type.

paramObj

Use this parameter to pass third-party specific values to your NexJ CRM application.

Example: {key1: value1, key2: value2, ... , keyN: valueN}

Response

  • Users can only open one dialog of the same type at a time. If they trigger a second openNexJPopup call, the function returns a status object with a status code and the name of the previous dialog of that type opened for that user.
  • The status code found in the status object depends on whether the dialog was successfully opened.

Testing openNexJPopup functionality

To test this feature in the development environment without access to a third-party application, use the test harness provided with the finance project. The harness is not active by default.

To enable the harness:

  1. Move the Dashboard_Harness.html file from the etc/adapters/popup directory to the meta/web directory.
  2. Move the NexJUtils.js file from the etc/adapters/popup directory to the meta/web/js directory.
For more information about using and configuring the function and the test harness, refer to the readme.txt file in the etc/adapters/popup directory.

Access the harness by changing the URL used for accessing your application. Replace ui/portal in the URL with Dashboard_Harness.html. For example, if the application is normally accessed from http://server.example.com:port/nexj/ui/portal, enter http://server.example.com:port/nexj/Dashboard_Harness.html in the browser's address bar.

Use the testing harness only in development or testing environments. Ensure that these files are not located in the meta/web directory in production. 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.