How to increment a field value using Lotus script on web

How to increment a field value using Lotus script on web ?

i am using x as a number field which is editable and has default value

temp:=@Max(@DbLookup(“”:“”;“”:“”;“sessiontest”;@Name([CN];@UserName);2));

@If(@IsError(temp);0;temp)

once the value is incremented i want to check on web on click of button whether the field x contains 7 and then using lotus script i want a msg box saying “competed”.

Pls suggest

Subject: How to increment a field value using Lotus script on web

I suggest that you create an agent with your logic and invoke this agent from the button. The NotesSession.DocumentContext refers to the current document.