Skip to main content

Hi!

 

I'm creating a custom object as a self-practice and I would like to know if there's some way to shortern date format. What I am trying to do it's some kind of market transaction researching database, where most of inputs are estimated, so it wouldn't be useful or confortable for my potential users to pick a concrete date. What should I do in order to create a field in my object whose date format would be MM/YYYY?

 

Thanks and greetings!

2 answers
  1. Jun 27, 2022, 1:34 PM

    There is no Month, Year, datatype fields in Salesforce, so you really have 2 choices

     

    Use a Date (MM/DD/YYYY) field Just instruct the users to select the 1st day of the Month 

     

    Create 2 custom fields for Mont and Year for the users to input, and create a Formula(Date) field on the back end that creates a MM/DD/YYYY value  so that you can still use Relative Date filters in your Report like LAST 12 MONTHS, or THIS YEAR, THIS MONTH, LAST QUARTER, 90 DAYS AGO...   

     

    Your Formula(Date) field would be something like this

     

    DATE( VALUE(TEXT(YearPicklist)), VALUE(TEXT(MonthPicklist)), 01 )