Find your content:

Search form

You are here

Salesforce visual workflow creating event

 
Share

Does anyone know how to create an event in visual workflow - i know how to create the record i am just having issues creating the date time piece as you can not create datetime fields in VWF.

At the moment i have a picklist of times and a date field, i want to try and concatenate these and add in the rest of the values as if i was using the apex data loader but having issues doing this


Attribution to: Charlie Lang

Possible Suggestion/Solution #1

You should be able to do date/time fields as of Spring 14. Just create a new variable like normal and choose DateTime as the variable type.

You should be able to use an Assignment element to "add" the data together, which will essentially perform a concatenation. You may need to also define a constant with a default value of " " (a space) to be between your date and your time, also concatenated in.


Attribution to: markross__c

Possible Suggestion/Solution #2

I strongly suspect the answer to your question is very similar to one that was just posted and answered a day or so ago titled Can we do custom datetime in visual flows? The methods you need were outlined in that post.


Attribution to: crmprogdev

Possible Suggestion/Solution #3

It's quite a long-winded approach, but I created a number of formula fields to cater for each of the datetime components and concatenated them together in a string.

YearFormula = YEAR({!RequiredDate})
MonthFormula = MONTH(...)

For the time component, I used:

TEXT({!Time}) & ":00:00"

where Time is the picklist value, which I exposed as a number.

The final step is to pull it together in another formula:

DATETIMEVALUE(TEXT({!YearFormula}) & "-" & TEXT({!MonthFormula}) & "-" & TEXT({!DayFormula}) &" " & TEXT({!Time}) & ":00:00")

On record creation, the value of the formula is written to the Datetime field.


Attribution to: Alex
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33402

My Block Status

My Block Content