- I have two documents, both of which do some client side JS to set a field, and both of which should touch off a legacy Agent in postSaveDocument. One of them works perfectly. The other one triggers querySaveDocument and dies right there. Both of them are using precisely identical code, copied from working to non-working using the Source tab, then editing as needed for the different data source name. Both of them have the same overall code in postSaveDocument, and both of them have a plain print() in querySaveDocument so I can see when it triggers. First line in both postSaveDocument is also a print() for the same reason. One works. One never hits pSD.- I’ve even deleted the custom control for the bogus one and re-created it. No effect.
Any ideas? Thanks for your time…
Subject: Somehow it’s postOpenDocument that does it…
-
The two are identical except the one that doesn’t work also run a legacy Agent in postOpenDocument. If I take that Agent run out, the broken one triggers postSaveDocument as expected, and the data is commited.
-
If I put that Agent call back in … no more postSaveDocument, and no more data commit.
-
Problem is that legacy code must run before rendering. If it does not the entire application is useless. I’m running legacy code because it will take a very, very long time to convert it all to JS, and that’s not practical.
How does an Agent run in postOpenDocument prevent postSaveDocument from running?..
Subject: SOLVED: There’s a save before the Agent runs…
- Because the simplest way XPages has to pass data to legacy Agents is with a parameter doc ID, when the Agent is run postOpenDocument it saves the data source prior to running it. It’s that save that prevents postSaveDocument from firing later.
Guess I’ll have to do this some other way…