Check fro blank attribute?
Folks,
hopefully an easy one for you all.
I currently have a workflow that needs to assign a new name to a fire that the user selects (ends up in the feature set selectedFS). What I need to do is check first to see if the field for INCIDENT_NAME is blank, so I use the following in an If..then
selectedFS.First().Attributes("INCIDENT_NAME").toString() is Nothing (and tried = "")
but it throws a
" Workflow Error - Exception... blah...
Object reference not set to an instance of an object ."
Obviously I'm trying to check against something that is not set and hence the problem! I've tried assigning a new variable to selectedFS.First().Attributes("INCIDENT_NAME").toString() - but this gives the same error!
any ideas how to quickly and easily check for a blank attribute value?
many thanks
Gareth
-
Hi Gareth
first thing is that there will likely be no Attribute returned is if the value is NULL in the database ( as compared to empty string).
So need to test if that Attribute exists first and then check what the value is ie:
If Activity with the test being:
not selectedFS.First().Attributes("INCIDENT_NAME") is nothing
and if that is sucessful then
If Activity with the test being:
selectedFS.First().Attributes("INCIDENT_NAME").Value = ""
then do stuff.
Makes sense?
Ralph Price
0 -
Ralph,
I'll give it a crack.. thanks mate..
GF
edit: worked like a treat! thanks again! Too logical for a non-programmer like me ; )
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer