AttributeError: 'com.inductiveautomation...' object has no attribute '...'

I tried to implement a retargeting in perspective.
So I wrote in a button the following code.

def runAction(self, event):

When I click on this button I get the following error:

AttributeError: 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'retarget'

tnx in advance

Look at the documentation - system.util.retarget - Ignition User Manual 8.0 - Ignition Documentation

Underneath the Scope section it will tell you where you can call this from -

You cannot use this in Perspective, only vision.

To navigate to another perspective project, you need to navigate to the URL of the other project.