1
votes

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

1
Put @IsError check inside that formula you evaluate.Frantisek Kossuth
I tried : var descr = new String('@If(@IsError(@Unique(@DbLookup("":"";"":"test/demo.nsf";"searchvg";"ARKD')+types[i]+('N";4)))),"no data",@Unique(@DbLookup("":"";"":"test/demo.nsf";"searchvg";"ARKD')+types[i]+('N";4)'); but this gives the same result ....Marc Jonkers
')+types[i]+(' should be '+types[i]+'teleman

1 Answers

1
votes

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";