System.retarget to previous screen (within project)?

Is there a way to use system.retarget to return to the “Calling” screen

I have a project “projectA” “screenZ” that uses system.retarget to jump to another project/screen “project B/screenQ”.

I’d like to return back to the screen that called “projectB” and not just the default screen for Project A.

Thanks !

The fpmi.system.retarget function includes an optional parameter to jump back to a different (non-startup) window. The command with all parameters isfpmi.system.retarget(projectName, [serverAddress], [parameters], [windows])The last 3 parameters are all optional:

  1. If the system you are retargeting is not on the same gateway, you have to enter its IP address.
  2. You can then specify a Jython dictionary of additional parameters to send, allowing you to pass data between the 2 systems.
  3. The last parameter allows you to specify a Jython sequence of window names you want to open instead of the default startup window(s).

There is a small gotcha if you do not want to use the second or third parameters, but still want to specify a startup window. From your example, if you are running the 2 systems on the same gateway and want to return to the calling window, you would use something like this:fpmi.system.retarget("projectA","",{},["screenZ"])Note that the other 2 parameters have to be included as an empty string and an empty dictionary.

Does anyone know a way to figure out the screen i was sent from so i could return to that same screen ?? (not just the default screen of that project.)

Back Button Example:

This code would be put in a button in the target that was retargetted to, and act as a ‘back’ button, that would retarget back to the original project. global _RETARGET_FROM_PROJECT global _RETARGET_FROM_GATEWAY fpmi.system.retarget(_RETARGET_FROM_PROJECT, _RETARGET_FROM_GATEWAY)

Just put the name of the return window into a parameter on the retarget, and then use that parameter when retargetting back by putting the param’s value into the retarget window list.