Null or Empty String in Data Directive condition

I have a DD that needs to filter out (i.e. not trigger) when a certain field (a string) is not set.

Do I use

image

or

image

or both (AND’d toegther)

image

Well you can’t use the AND’s together, you would have to use them OR’d together, because it can’t be null and empty, it has to be one or the other.

I’m using ‘is not equal to’

Or am I missing something else?

To be clear, the whole condition is:

((whse == ‘mfg’ AND plant ‘!= MfgSys’)
OR (whse == ‘Guth’ AND plant != ‘GUTH’)
OR(whse == ‘Hous’ AND plant != ‘HOUST’)
OR(whse == ‘Rock’ AND plant != ‘ROCKSP’))

When that is true send me an email

But emails were being sent out with empty values for PartNum, Plant, And WarehouseCode

So I decided to add a check for blank PartNum, by adding

AND (PartNum != null AND PartNum != ‘’)

Gotcha, missed that. I guess I probably split up my criteria a little more so there are more widgets and less things on each one so they are easier to understand. I also use the false side out, which is why I assumed equal and not the other way around. If it were me, I would probable break them up and add some message boxes to test for things.

I doesn’t seem like empty or null should make it through that anyways even without the added condition :thinking:

Some background … There’s a bug in E10 that makes bad PlantWhse records - a record with a Whse and Plant combo that don’t exist. These create erros in the QOH used for PO suggestions, Time pahase, etc. Even though the QOH in PartBin is correct.

Support sent me a data fix to run. And it fixes the bad PlantWhse records. My DD was an attempt to monitor when the bad records are created, so I know the fix needs to be run again.

I originally had a typo(misspelled one of the plant ID’s), and it was firing (shooting off the email) when it shouldn’t have. But at least I knew it would trigger. After fixing the type, I stopped getting the emails that I should not have been getting.

But I occasionally get ones with all blank values. Here’s the body of the email

Plant: 
Whse:  / 
PartNum: 

DateTime: 12/11/2018 5:05:35 PM

When it should be like:

Plant: HOUST
Whse: Hous
PartNum: CB-0006

DateTime: 11/26/2018 9:45:26 AM

from the following email template:

image

I traced the that date time back to a new part being created, but that didn’t create the bad record I’m monitoring for.

For things like that, I like using BAQ gadgets. Anything you can find in a BAQ you can throw on your home screen. Then then these can be run at certain time schedules. When something shows up, it means I should go check it out. I like that a lot better than e-mails.

1 Like

The emails were also sent to the purchasing folks, so they would know to be skeptical of the QOH of a flagged part. At least until I got to run the data-fix.

I guess I could make a BAQ Report and schedule it to email daily. If no records exist, than no email goes out…

But that doesn’t answer the question as to why the DD triggers, but the resulting email has blanks for the field values.

A bit of a shot in the dark here, but have you tried using String.Empty instead of “”?

You could also do a custom code condition and check the length of the PartNum string. Although if you’re doing that you may as well just use the String.IsNullOrEmpty and/or String.IsNullOrWhiteSpace methods.

1 Like

And when you’re on vacation, others can see the messages. However, I have no problem with an email (or text or IM) that says, “Check the Sysadmin Dashboard. You’ve got issues…”

I just beat my head against the wall for a different BPM. I ended up just comparing the subject field to another blank field that we never use. If they are equal then the BPM fails.

This should work for checking an empty string in a directive.