I have a field with an @Contains statement and it works fine except on one particular document where it returns null. How can I assign a default value when this happens? This is the code for the field:
list := @DbColumn(“”;“”:“IBMInventory.nsf”;“ViewforSenateInventory”;1);
result := @Contains(@Uppercase(@Trim(@Text(list)));@UpperCase(@Trim(@Text(Serial_Num))));
result
The @DbColumn command is working, but the @Contains is coming back as null for one particular document. So, then I’m unable to open the document.
Subject: @Contains not returning 1 or 0
How about first checking whether list or Serial_Num contain any value?
Something like this:
list := …
@if(Serial_Num = “” | list = “”; result = “oops”; result := …your code …)
BTW: is is R6 code - won’t work in this syntax in R5
Subject: You missed a “:” in the first assignment
Subject: RE: @Contains not returning 1 or 0
I added the code to check for blanks and it still is not opening the document. When the @Command executes, it doesn’t find the serial_num in the other database and it doesn’t set the field to 0. It sets the field to null. The list and the serial_num are not blank.