FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.


Dec 11, 2016, 7:57 AM
2 Posts

Corrupted LotusScript Onchange events

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: onchange
  • Replies: 2

I have developed a pure Notes client application that has been up and running for a couple of years. Suddenly something has happened to my template file, which will destroy functionality if pushed into production.

The main form has over 1000 fields. About hundred of them have on change events. Now I have discovered that the event has changed "automatically", i.e. without my concious doing.

This does not work, because "onChange" is the exact event name for the JavaScript event.

If I delete the code, move out of the event and move back, the code type has changed to "JavaScript":

Then I can select LotusScript, paste the code back and thus make the event work again. Now the event name is "Onchange".

 

To do this on all fields in all forms is nothing I look forward to do. Is there any other way?

 

Production server: Domino Release 9.0.1 FP5 HF21

Development server: Domino Release 9.0.1

Designer client: Release 9.0.1FP6

Dec 15, 2016, 4:57 PM
82 Posts
Proceed with caution and no guarantees ...
Corruption is nasty and many times you cannot recover from it.  If you already looked at something like this:

http://lotusibm.com/database-corruption-and-troubleshooting/

and it has not helped.  And you've already got a backup of the app in case you break something else.  Copy the problem form into a brand new db,  Open that db in designer.  Right click on the corrupt form in the Forms list in the database bookmark panel (ie, on the far left where you see all the db elements) and from the context menu choose 'Edit with DXL' (the prompt that says 'Editing DXL of design element can cause loss of information' is not lying).  When the Form opens click the Source tab towards the bottom (you will see a Design tab and a Source tab).  You will see things like:

field type='text' kind='editable' name='z'><code event='onchange'><lotusscript
>Sub Onchange(Source As Field)
        Print "bob"
End Sub
</lotusscript></code></field>

and/or

<field type='text' kind='editable' name='a'><code event='onChange'
 for='client'><javascript>alert('test')</javascript></code></field>

The Edit menu at the top has a Find/Replace selection that just might be your friend.  Good luck!
Jan 8, 2017, 4:46 PM
2 Posts
DXL editor doesn't show the event corruption

Thanks, Bob. But in the DXL editor the fields look normal. I have checked the form both in my template and in a new nsf, as you recommended.

I had forgot about the DXL editor, but I have used it before for copying fields and doing find & replace. It's very convenient when you name fields with an index like above.


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.