you can paste the code below into the init form. If you have any questions about the code, feel free to ask!
public void init() { #define.CACHE_OWNER ('MyForm') #define.CACHE_KEY_INSTANCE ('Instance') FormRun existingForm() { ; if (infolog.globalCache().isSet(#CACHE_OWNER, #CACHE_KEY_INSTANCE)) { return infolog.globalCache().get( #CACHE_OWNER, #CACHE_KEY_INSTANCE); } return null; } void registerThisForm() { ; infolog.globalCache().set(#CACHE_OWNER, #CACHE_KEY_INSTANCE, this); } boolean isAlreadyOpened() { ; return existingForm() ? !existingForm().closed() : false; } void activateExistingForm() { ; existingForm().activate(true); } ; super(); if (isAlreadyOpened()) { activateExistingForm(); this.close(); } else { registerThisForm(); } }
source share