Record to Modal, back to Record...
I have a layout for contacts called 'People':
All the fields on the layout are non-Browse to prevent accidental editing. Two buttons (New and Edit) open up a Modal window for editing purposes.
After clicking the 'Save' or 'Cancel' button, I want to return the user to the original record they were browsing so I tried the script shown below for the 'Save' button:
Commit Records/Requests 
Set Variable [$$id; Value:People::__kpPeopleID]
Close Window [Current Window]
Adjust Window [Maximise]
Refresh Window [Flush cached join results]
Set Field [People::__kpPeopleID; $$id]
This appeared to work yesterday but I've just noticed that duplicate values have appeared in the People tables primary key. I've changed this to disallow duplicate values but now the above script won't work.