Link to home
Start Free TrialLog in
Avatar of Andrew Narunsky
Andrew Narunsky

asked on

After editing or adding LotusScript code to a Shared Action in Lotus Notes Database and then closing all the code is lost

In a Lotus Notes database template file, if I edit one of my existing Shared Actions (or add code to it), and then save and close, when I open it again all the code is gone, i.e. nothing in Options/Declarations/Click, etc. I have run fixup, updall & compact on the database. Code is LotusScript.
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

No clue... I have to confess that I rarely use Shared Actions, probably because I use libraries quite a lot.

Which Notes and/or Designer versions?
Avatar of Andrew Narunsky
Andrew Narunsky

ASKER

Designer 9.0.1 with FP10. Sjef, after reading your comment I put my code into a Script Library (not sure if this is what you were referring to). After it saved I started testing - found a small bug, edited the code, saved. Later went back in and all the code is gone - it just does a disappearing act. Frustrating.
There were some flaws in the V9.0.1 code, although FP10 is a very decent release. Do you mean that the code in the script library vanished as well?? That would be a new one to me.

I never use shared actions because I put the real code in a script library and leave only one Call in the action itself. Like this:
Use "Actions"
Sub Click
   Call SharedActionCode
End Sub

Open in new window

That way, I don't feel too guilty about not sharing the action, even though I might have to select the same icon and write the same hide-when code in the action itself.

A different approach, one that unfortunately only works on forms, is using a subform with the actions.

Other ideas:
- upgrade to V10 or V11, and do some tests
- or ask me to test it (prepare a test database without encryption and with an open ACL that contains only the shared action)
- make a Notes-style copy of your database and try modifying the code there (it could be a bug in your replica only)
- fixup??

Yes, the code vanished in script library as well. Very weird stuff. I did exactly as you have illustrated above (i.e. only 1 call in Action itself).
I have V10 installed on my laptop, so I might give that a go and see what happens, otherwise will send u test database (thank you for your kind offer). Keep you posted.
I already performed Fixup and didn't help.
By the way, I do my design/code in a .ntf and only refresh design of .nsf (production database) when tested. I haven't tried editing the code in .nsf yet to see if same problem.
Update: Same thing happens with V10.
Sjef, how do I upload test database so only you can see? Will have to do later this week or early next week.
How odd...

Don't upload, but send it to my mail address, you'll find it in my EE-profile, at the bottom of the full bio. If you need to contact me, I'm on Skype as well. And Twitter. I do have a pretty unique name... :-)
email sent. Thanks
Definitely something rotten in the database. Sometimes, when opening in the Designer (V11), it even destroys the tree display of other databases (at the left, Shared Actions disappears, Database Script disappears, etc).

If you can:
- start with a fresh template database
- copy all elements over, forms, views, the lot
- move all code in Shared Actions to separate Script libraries (libraries are much more reliable)
- leave one line of code in a shared action, to call the click function in the library
- file a case with HCL
I will definitely try this - and revert once I have done (probably within next 2 weeks). Thanks
26 - 9 = 13 right? ;-)
something like that! I started this process last week, but got tied up. Intending to finalise this week. Will keep you posted.
So I managed to do all of this and soon after the same issue occurred. What I did discover, however, after the code 'disappears' if I close the Script Library without saving and then reopen it, the code reappears. I feel like I'm working with David Copperfield. So due to lack of time I will continue working like this and look for further solutions down the track. I will ask my IT integrators to check out my environment to see if this may have any affect.
Super weird behaviour! Ok, one more idea then: put the code in a new template database and see if you can safely modify the code there. If it does, copy/paste the library and the agent in your own template and keep the source template. Yes, you can have nested templates, all you have to do is Refresh Design on your template, and then Refresh Design of the application.
There is no current solution. I have discovered if I open an action or script library and there is no code, I just close it, open another action/library, close that one, and then reopen the original one and the code appears. Seems to be a glitch in my system. I will leave it at this for the time being as I don't currently have time to investigate further. Thanks Sjef for the various recommendations. How do I 'close' this question based on this?
It's just one more incomprehensible issue with Notes or Domino... although many have been resolved over the years.

Ok, IMHO there are two ways to close this question: accept your "no current solution" solution, or simply ask the Mods to remove this question. There is definitely value in it, but only to some specialists at HCL probably. And with V12 being released at the moment, it's probably not even that interesting...

Please do the needful! ;-)

ASKER CERTIFIED SOLUTION
Avatar of Andrew Narunsky
Andrew Narunsky

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial