EKL: Check Editability of Root Product When Opening & Switching Editors

I am working on a script to display a warning message to my users that informs them that modifications to a product can't be saved. They often open a product, spend lots of time working on modifications only to find that it has been released or they have invalid credentials.

I understand they SHOULD be doing their due diligence to check those things proactively but I am just trying to deliver an enhancement for them. They'd really appreciate a warning message letting them know they can't save changes to a product.

I have the notify portion of the script written already but I need to actually check for editability (first issue) and then I need a BL opener to run the script when they user opens new content or they switch editors/tabs.

Soliciting ideas from the CATIA community! 🙂 

 

let roots(list)
let editorRoot(VPMReference)
let editorRootName(String)

roots = GetEditorRoots("VPMReference")
editorRoot = roots[1]
editorRootName = editorRoot.V_Name

Notify("Saving modifications on # is not allowed.
You are allowed to locally modify the object but you won't be able to save your modifications.
If you feel that you should be allowed to save your modifications...
- Check that your credentials are set appropriately.
- Check if the content is reserved (locked) by another user.
- Check that the content is not in the 'released' maturity state.", editorRootName)

 

I've been looking through the Data Setup app to find an opener but I can't for the life of me find anything helpful.

EKL