There's a few things I'm keeping in mind.
1) It would be great to not show a comma in the year field (i.e. "2,015")
2) We'd want to be able to report on month + year combinations, in ascending order
3) The data will be coming in from a third-party service in separate fields, so these need to be separate fields as well
4) Text fields could remove the comma from display on a page layout for a year, but don't properly sort for month fields, since although numerically "2" comes before "10", sorted as a text field "10" would come before "2"
5) I have a feeling we could store the data as either text or number, and use validation formulas and formula fields to change the display on a page layout...but I'm looking to hear from people that have gone down one route or another and their general happiness
So, what do you think? Store month and year fields as text or numbers?
3 respuestas
Okay if you need it to be treated as a Year and a Month then I would start the value in a Number or Text field and create Formula Date field that uses the Year and Month to fill in the YYYY and MM value in Formula(Date) like this:
DATE( YYYY_Number__c, MM_Number__c,01)
or this
DATE( VALUE(YYYY_Text__c), VALUE(MM_Text__c) , 01)