system.perspective.openPopup, sessionId Optional but puts logs and error

Ah, that makes sense, thanks @cmallonee.
I found Show a popup in perspective on all clients if a value changes - #30 by jlandwerlen and will dive into it.

This works.

popupId = "Test Popup"
		viewPath = "Test/Ted/Test Automatic Popup"
		logger = system.util.getLogger("Test Popup")
		logger.info("Testing popups.")
		sessions = system.perspective.getSessionInfo(projectFilter="ProjectX")
		for session in sessions:
			for pageId in session.pageIds:
				# logger.info("{0} | {1}".format(session.id, pageId))
				if currentValue.value:
					try:
						## Wrapped with 'try' because some sessions info productes errors:
						##     - java.lang.IllegalArgumentException: Invalid UUID string: 066328F8
						system.perspective.openPopup(popupId, viewPath, sessionId=session.id, pageId=pageId)
					except:
						logger.info("system.perspective.openPopup failed:  " + "{0} | {1}".format(session.id, pageId))
				else:
					try:
						## Wrapped with 'try' just incase it produces errors.
						system.perspective.closePopup(popupId, sessionId=session.id, pageId=pageId)
					except:
						logger.info("system.perspective.closePopup failed:  " + "{0} | {1}".format(session.id, pageId))
1 Like