Marc Jonkers
Marc Jonkers

Reputation: 506

sessionAsSigner evaluate @DbLookup error handling not working

My code :

var descr = new string('@Unique(@DbLookup("":"";"":"test/demo.nsf";"searchvg";"ARKD')+types[i]+('N";4))'); description = @If(@IsError(sessionAsSigner.evaluate(descr)), "no data", sessionAsSigner.evaluate(descr));

When there's no error , the variable description will get the value of the lookup. When the data of the lookup doesn't return a value , the variable description doesn't get the value "no data", and I get an error message :

Exception occurred calling method NotesSession.evaluate(string) null

Upvotes: 1

Views: 149

Answers (1)

Frantisek Kossuth
Frantisek Kossuth

Reputation: 3524

Try this:

var descr = 'tmp := @Unique( @DbLookup( "":""; "":"test/demo.nsf"; "searchvg"; "ARKD' + types[i] + 'N"; 4 )); @If( @IsError( tmp ); ""; tmp )';

description = sessionAsSigner.evaluate(descr);
return description ? description : "No data";

Upvotes: 1

Related Questions