Workflow "Less Than" not triggering when field is NULL

Hello!

I’m new to SuiteCRM and trying to get my head around Workflows. Everything makes sense so far but I am having trouble with using dates as conditions.

I am trying to see whether the Start Date of a call is later than the date set in a custom field (Last contacted). The workflow doesn’t run if the custom field is empty (which I’d like to remain the default). Here is my condition:

Contacts | Last Contacted (custom field) | Less than | Field | Start Date

It works fine when Last Contacted has a value but doesn’t if it is empty. Any ideas?

Thanks!

Hi, welcome to the Community! :tada:

Maybe you could add a second condition checking for the NULL value?

Or you could use a default like 1st Jan 2000 which everybody in your Company would know means “no date”.

Hello!

Thanks a lot :slight_smile: I’ll give it a go

Or you could use a default like 1st Jan 2000 which everybody in your Company would know means “no date”.

@pgr’s suggestion is a simple solution, but there are two caveats:

  • Setting such a default doesn’t, AFAIK, update existing records (but you could e.g. create a temporary workflow to run through all records and change the date to default when the value is NULL)
  • Using a default value might break reporting, if one wanted to run statistics on e.g. average time since last contact.

Ei neither is an issue for you, then that’s by far the easiest option.

@rdrane27: How does the last contacted field get its value in a record? Is it manually entered or is there some automation? I need to add a similar “Last Invoice Date” field to Accounts, so I’m curious.

My work-around was to create a workflow that would set the custom field to today’s date when a contact record is created. Annoyingly, it seems you can’t set the time for “now” so I had to do “today” + 00hrs (which is midnight on the date the record is created).

It wasn’t perfect but was more than enough for me.

1 Like