Hi
The following only happens when using LN6, LN5 works fine.
Task:
We use a small dialog to rename a bunch of documents, i.e. in a Project Database to rename a Project Title. The user shall be able to have an agent doing the job, preferably at times no other user has a document in use. The dialog allows to set the time the agent will run.
Code:
The script is based on Rods Source Code, http://www-10.lotus.com/ldd/46dom.nsf/c21908baf7e06eb085256a39006eae9f/65389424caefa06980256b260051da56?OpenDocument
(Thank you for posting this!).
From within the dialog a customised OK Button will call the SetAssistInfo function to set the agents run time (+ stop time). The script then sets the agent to IsEnabled and saves it using Lotus Script.
Problem:
As said, this works fine for LN5. Within LN6 we get a nice msgbox, saying: “Document has been modified or corrupted since signed! (data)”.
Trials:
To avoid this, we set the agent IsEnabled property via API, too. That means we use
NSFItemSetText hNT , “$AssistFlags”, “Es”, 2
to enable + schedule it
NSFNoteSign hNT
to sign the document
NSFNoteContract hNT
to compress data in the note
before we write the document back to disk (NSFNoteUpdate).
That does no longer raise an error - but the agent never will run. If we look at the agent it looks perfectly fine, no obvious errors etc. (In case the agent was disabled before our script ran, it will be enabled now, etc.) If we test the agent it gives back “Unable to run agent; data is corrupt!”.
Once the agent is saved manually it will work as expected (using the settings assigned via the API calls).
Again, the same stuff works in LN5.
We tested quite a lot with slightly different results (once the agent ran but gave the
Question:
Could anybody put some light on this.
Lotus, if this is a new security feature, thank you.