Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
@function is not valid in this context

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#NotValidInContext or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/NotValidInContext

"HTTP Web Server: Lotus Notes Exception - @Function is not valid in this context"

What does this error mean, how to avoid it and how to solve it.


"HTTP Web Server: Lotus Notes Exception - @Function is not valid in this context"

This occurs on a browser and means that the form being used is trying to use a Notes Client compatible @formula command when they are not appropiate.

The most common one is @prompt.

How to Avoid

To avoid them use something like:

@if(@iserror(r) & @clienttype="Notes";

@return( @prompt([ok];"Error";"Field name"));

@iserror(r);

@return("Error in field Name");

"");

This code displays a a prompt message if the form is being used in notes otherwise it puts a message in the field.

How to Find the Field

This is a painful process, first check your fields for likely suspects, if you have lots of fields then make a copy of the form, then remove 5 or six fields starting from the bottom of the form then test it again on the web. If the error goes away, then you know the error was in those five fields. If not remove a few more again from the bottom of the fom, then test again.

 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
man and boy by Tony Parsons
British book of the year 2000. Great book, hard to put down, but I nearly threw it away half way through. You'll know why when you read it.
See at: Amazon.co.uk | Amazon.com |