+ Start a Discussion
DohDoh 

Flow Designer Date Initialization

I'm working on a business flow that requires date manipulation and when I define a flow variable with a data type of date the default initializes itself to Dec 31 1969.

 

I need to set the default date to null for use in comparing empty date fields in a dated history. An allocator only offers the (Current Date) as an option under "Functions and internal value elements". If I try to make the variable initialization null or 0000-00-00 or 0 or 00-00-0000 none are acceptable.
(Tip: do not setup a variable as a numeric data type and after saving it change it to a date ... delete the variable and start again with the date data type defined from the start otherwise you get all sorts of strange stuff happening!).
Does anyone know of a way to initialize a variable date field in Flow Designer to be a null value initially?
I've reported the issue to Salesforce because it seems to be a bug.
The latest documentation is very introductory which is great when starting out but once you get into complex stuff there is no technical reference. For example the "Functions and internal value elements" is not mentioned so how are these defined? The only pre-defined function is current date.

 

Best Answer chosen by Admin (Salesforce Developers) 
DohDoh

I reported the problem to Salesforce and they confirmed this is a "feature". I call it a bug. Basic computer science requires that variables can be properly intialized either at the time they are defined as a specific data type and definitely as a specific value subsequently if required. They suggested I post the issue in Ideas. I hope that now that Salesforce owns the product and the imminent release (end of year probably means Spring 2012 :-) of the web based version they will build in more native support such as support for all the data types (e.g. datetime) and proper initialization.

 

I too have figured out workarounds and I'm still a fan of the product despite its limitations.

All Answers

Silkcutz01Silkcutz01

I agree totally Doh re: the resources available for Flow. Poor for complex.

 

In terms of having a blank default value - I have being working with Flow and its previous incarnations for nearly 4 years and have never been able to have a blank default value, so I hope they do but unfortunately unlikely I feel.


The only thing I would do in your position is treat Dec 31 1969 as the equivalent of a blank value.

 

The dates are a big issue with Flow.In previous incarnations I have had to build in all sorts of workarounds which I wont bore you with but there are real compatibility issues. Flow was a product Salesforce acquired.

 

 

 

DohDoh

I reported the problem to Salesforce and they confirmed this is a "feature". I call it a bug. Basic computer science requires that variables can be properly intialized either at the time they are defined as a specific data type and definitely as a specific value subsequently if required. They suggested I post the issue in Ideas. I hope that now that Salesforce owns the product and the imminent release (end of year probably means Spring 2012 :-) of the web based version they will build in more native support such as support for all the data types (e.g. datetime) and proper initialization.

 

I too have figured out workarounds and I'm still a fan of the product despite its limitations.

This was selected as the best answer