Custmize DB Lookup error message?

I have the following lookup formula attached to a field:

@Unique(@DbLookup( “” : “NoCache” ; “” : “” ; “IDPUBLU” ; Product_Name ; 2 ))

When there is no value present in column 2 to lookup, the returned error message is “Server error: Entry not found in index”.

Is there someway to customize the message to something different eg. “Enter your deliverable name in the New keyword field below”?

Subject: Custmize DB Lookup error message?

Check out “@IsError” in the formula help. This will allow you to check for an error condition from a DbLookup.

Ex.

ListValues := @DbLookup( “” : “NoCache” ; “” : “” ; “IDPUBLU” ; Product_Name ; 2 );

HasError := @IsError(ListValues);

@If(HasError;“@Prompt with your error message here”;@Unique(ListValues));

This is the general idea, hth

regards

Subject: RE: Custmize DB Lookup error message?

Thank you all :slight_smile:

This is the code that worked for me:

ListValues := @DbLookup( “” : “NoCache” ; “” : “” ; “IDPUBLU” ; Product_Name ; 2 );

HasError := @IsError(ListValues);

@If(HasError; “Enter your deliverable name in the New keyword field below”;@Unique(ListValues))

Forever grateful for your expertise!

Subject: Custmize DB Lookup error message?

Lkup := @Unique(@DbLookup( “” : “NoCache” ; “” : “” ; “IDPUBLU” ; Product_Name ; 2 ));@If(@IsError(Lkup); @Prompt([ok]; “Missing Data”; “enter your deliverable name in the New keyword field below”); Lkup);

(Not tested)

Subject: Custmize DB Lookup error message?

It can be done like this:

mylist := @Unique(@DbLookup( “” : “NoCache” ; “” : “” ; “IDPUBLU” ; Product_Name ; 2 ));

@if(@iserror(mylist; “my error mesage”; mylist);

You can have a look at @iferror too…

Subject: RE: Custmize DB Lookup error message?

Don’t use @iferror - it was dropped in R7