function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
projenhaprojenha 

formatting date in visual workflow

I'm working with a few date fields in Visual Workflow, and the date fields on my records update fine. However, there are a few places where I'd like a date to be part of a record's name. I've created a text template for the record name that combines the date in question as well as other information such as last name. I've got some Record Updates that then populate the name field. This works fine.

 

The issue is that when displayed through the text template, the date is displayed as Month DD, YYYY (e.g., "November 16, 2012"). I'd like to minimize characters in my record names, so would prefer either MMDDYYYY or MM/DD/YYYY. I've tried formating the date in the text template as I would in a standard formula field or other places, but nothing I've tried seems to work. I'm guessing this is very simple and I'm just missing something.

 

If anyone has any suggestions, I'd appreciate it!

Best Answer chosen by Admin (Salesforce Developers) 
RajaramRajaram

Depends on that type of formatting you are trying to do. If its just numeric then you can use formulas for getting the date/month/year and use them as merge fields. Makes sense?

All Answers

RajaramRajaram

The display date is always in the locale of the current user.

If you are ok with a hack, i can propose something.. :)

projenhaprojenha

I'd love to hear your proposal!

RajaramRajaram

Depends on that type of formatting you are trying to do. If its just numeric then you can use formulas for getting the date/month/year and use them as merge fields. Makes sense?

This was selected as the best answer
projenhaprojenha

I have done what I think you recommend and for the most part it works. Unfortunately, for the year it automatically adds a comma so instead of "2012" I am getting "2,012". For now I am just subtracting 2000 since I am only interested in the last two digits anyway. So this should work until the end of the century, at least! Thanks.