Link to home
Start Free TrialLog in
Avatar of ozone7
ozone7

asked on

Checking if a Field is NULL!

I have a Script that I wan to check and see if a certain field is NULL, if it is not NULL I am going to write/print several fields from a Doc to a text file. If this one Field is NULL, I do not want to print/write, just go on to the next field I am checking ..

I am not sure if I use the ISNULL or doc.field=NUL. I am having problems getting anything to work..

Rookie Here! Help!
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

First, check if the (notes)item exists.  Then, if it exists, you can check for the empty string with a conversion to text (there are other possibilities)

if doc.hasitem( "YourField" ) then
if doc.getfirstitem("YourField").text = "" then
' empty string ! ok !  This works for numbers, dates, strings, that are empty OR null
doOK()
end if

else
' no field - ok !

doOK()
end if

sub doOK()
' code to execute
end sub
Avatar of p_partha
p_partha

if doc.<yourfieldname>(0) ="" then
msgbox "it's empty"
end if

Partha
ASKER CERTIFIED SOLUTION
Avatar of qwaletee
qwaletee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
all the answers are on target.

Good going..