![]() |
Conditional Send with Null Field |
Post Reply
|
| Author | |
CoQ10
New User
Joined: 14 Jul 2008 Location: Minneapolis Posts: 32 |
Post Options
Quote Reply
Topic: Conditional Send with Null FieldPosted: 11 Mar 2010 at 11:13pm |
|
Hi,
I am trying to trigger a conditional Email send based on a database field. If the field (string) has a non NULL value I would like to send the Email. I am having trouble testing for the NULL condition. I tried testing for 0, String length and IsNull , nothing is working so far. During the database lookup I set the val to 0 if nothing exists. FieldStr = FIELDS_Value("EmailContact4") AddressLen = Len(FieldStr) ' Len fails also Result = IsNull( FieldStr) If Result Then Email2DBSend = False Else Email2DBSend = True End If Thanks Paul |
|
![]() |
|
CoQ10
New User
Joined: 14 Jul 2008 Location: Minneapolis Posts: 32 |
Post Options
Quote Reply
Posted: 12 Mar 2010 at 5:20pm |
|
I solved the problem, it helps if you type the variable name correctly.
I ended up using AddressLen = Len(FieldStr). Hopefully this will be a reliable way of detecting NULL database fields?
|
|
![]() |
|
Stephen
Admin Group
Joined: 21 Oct 2005 Location: Stoke on Trent Posts: 1131 |
Post Options
Quote Reply
Posted: 13 Mar 2010 at 9:02am |
|
Email2DB will always return a blank string or a zero value if the field is null.
So a test for Len(Field) = 0 is the best option.
Steve
|
|
![]() |
|
CoQ10
New User
Joined: 14 Jul 2008 Location: Minneapolis Posts: 32 |
Post Options
Quote Reply
Posted: 17 Mar 2010 at 2:43pm |
|
I am getting the error *Error lookup field:Invalid use of Null
*SQL Was: SELECT * FROM ContactTable WHERE ModelSerial = 'M87_1256'. I modified the Lookup field to place a 0 if no value is returned but this did not eliminate the error. How do I eliminate this error for a blank database field? Paul |
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |