How to make portal.show event fire on other portals

Question / Problem

I am using portal.show event in the system wide JavaScript customization. But this event only works on the default portal. When I move to my second or third portal, event does not fire. If I go back to my default portal, event fires.

Is there any way to make this event fire on other portals too?

Code / Attempts

I used this simple code just to check when the event fires (it shows a dialog):

(function () {

  "use strict";

  kintone.events.on("portal.show", async () => {

    const result = await kintone.showConfirmDialog({

      title: 'Popup',

      body: 'JavaScript initiated',

      showOkButton: true,

      okButtonText: 'OK',

      showCloseButton: true

    });

  });

})();

A dialog appears when portal event fires.

Desired Outcome / Expected Behavior

I want dialog to appear when other portals are shown too.

If there is also a way to know which portal triggered the event (portal2, portal3 etc), that would also be helpful.

Hello @zebra_taxi

If by your second and third portals you mean the Portal pages of different Spaces, you will need to use a different event.

portal.show is the event for the main Kintone Portal. For a Space Portal, use:

space.portal.show

Could you try using this event and see if it works for your Space Portals?

Thank you.

Hi sorry for late reply

I mean company wide portals and not space portals.

I can make many company wide portals using this feature but I have issues for triggering event.

Hello @zebra_taxi

Thank you for the clarification!

I now understand that you're referring to additional Portals created through the Portal Management feature rather than Space Portals.

According to the official Kintone documentation, the portal.show event does not trigger on the second or subsequent Portal pages. This explains why your code works on the preset Portal but not on the additional Portals.

While this limitation is not explicitly mentioned in the English documentation, it is noted in the Japanese version:

Unfortunately, I could not find an officially documented JavaScript event that would provide the same functionality on additional Portals.

I hope this helps clarify the behavior!

Understood. Thank you for this. I hope Kintone documentation updates portal.show page