Skip to content

Popup Applet Class

Oleg edited this page Jan 21, 2020 · 4 revisions

Class NexusPopupApplet extends the base applet class and intended to instantiate a popup applet:

  • addRecords(cb) returns Boolean. Adds a record positioned (or several selected records) in the association applet into the MVG applet.

  • addAllRecords(cb) returns Boolean. Adds all record displayed in the association applet into the MVG applet.

  • deleteRecords(cb) returns Boolean. Deletes a record positioned in the MVG applet. Note: the method is not able to delete the primary in visibility MVG, and displays the error message.

  • deleteAllRecords(cb) returns Boolean. Deletes all records in the MVG applet. Note: the method is not able to delete the primary in visibility MVG, and still returns the true value.

  • pickRecord() return Boolean. Picks the record positioned in the pick applet and closes the pick applet.

Simple Example with Pick Applet

It instantiates the pick applet, checks the length of the record set, queries in the recordset, and picks the record.

const obj = await nexus.showPickApplet('Audit Employee Last Name', true, null);
if (obj.appletName !== 'Pharma Employee Pick Applet') {
  alert('Pharma Employee Pick Applet is not created');
}
const found = await obj.nexusPopupApplet.query({ 'Last Name': 'Abel' })
if (found !== 1) {
  alert('Abel is not found');
} else {
  obj.nexusPopupApplet.pickRecord();
}

This example assumes that PR files for popup applets deployed

Simple Example with Association Applet

For child applet in M:M relationship context, the NewMethod displays the association applet, and the CreateRecord creates a new record that will be associated on commit. There is a simple example of association the record using the standalone association applet.

nexus.openAssocApplet((obj)=>{
  console.log(`${obj.appletName} opened`);
  const assoc = obj.nexusPopupApplet;
  assoc.queryByIdSync('8SIA-78SPE');
  assoc.invokeMethod('AddRecord');
});

This example assumes that PR files for popup applets deployed

This is just an example, it does not check if the record is found in the association applet or if the record is already associated. If the record is associated, the The selected record has already been added to the list. Please add another record or close the pop-up list and continue. (SBL-DAT-00357) error message is displayed. The same method could be used to associate several records at once.

Closing the Popup Applet

When the popup applet is instantiated, the custom PR application is responsible for closing the popup applet. With the Nexus Bridge it is possible to update other controls when the popup applet is "open", however it could lead to data corruption as Siebel PM for the originating applet will not not updated. Therefore the best practice is always explicitly close the popup applet, and don't update the controls on other applets when the popup applet is "open".

The popup could be implicitly or explicitly closed:

  • When the custom PR application explicitly "closes" the instantiated popup applet.
  • When the custom PR application explicitly "opens" another popup applet.
  • When the custom PR application calls some action that causes the implicit closing the applet, e.g. navigating to another record in view applet.
Clone this wiki locally