Be Careful with "Is before" and "In past before" date field operators - they include records where the date field is empty

Michael_Florin
Level 10

Re: Be Careful with "Is before" and "In past before" date field operators - they include records where the date field is empty

That doesn't work for Custom Objects with a potential one-to-many relationship. If your Smart List is:

Has Custom Object A with constraint "Trial Start Date in past before 14 days"

AND

Has Custom Object A with constraint "Trial Start Date is not empty"

it will return persons with two COs where only one of these COs has an empty Trial Start Date.

Denise_Greenb12
Level 7

Re: Be Careful with "Is before" and "In past before" date field operators - they include records where the date field is empty

Hi Michael,

Well, sure - because the person with the two COs qualifies for that logic. This is similar to dealing with logic based around Opportunities (say you want something to happen when an Opportunity is closed:lost - but only if the person has not other open Opportunities). Because someone can have more than one of them you have to use more complex logic. If this is something you are wrestling with I'd be happy to offer a suggestion if you explained what you were trying to achieve.

Denise

Grant_Booth
Level 10

Re: Be Careful with "Is before" and "In past before" date field operators - they include records where the date field is empty

My advice would be to never use the Before logic. Just use the Between logic with a very low boundary. I agree about adding a warning in the UI though!

Denise_Greenb12
Level 7

Re: Be Careful with "Is before" and "In past before" date field operators - they include records where the date field is empty

Hi Grant -

That's a good suggestion (between with a very low boundary). It wouldn't have worked for me in this instance though because I needed "in past before 1 hour."

Please vote for the warning in the UI idea here:

Thank you,

Denise