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
certi_vimalcerti_vimal 

Anniversary Date field in 2 formats



I have a requirement where user can be allowed to fill its Wedding Anniversary Date in 2 formats :-

- MM/DD/YYYY
- MM/DD

I know with standard Date field this is not possible, so I may need to use text field type.

However, I am struggling to write Validation Rule for the same. This is my Val Rule in construction :-

(NOT(ISNUMBER(RIGHT(Wedding_Anniversary__c, 2)) && ISNUMBER(LEFT(Wedding_Anniversary__c, 2)) && VALUE(LEFT(Wedding_Anniversary__c, 2) ) <= 12 && VALUE(RIGHT(Wedding_Anniversary__c, 2)) <= 31 && VALUE(LEFT(Wedding_Anniversary__c, 2) ) <> 0 && VALUE(RIGHT(Wedding_Anniversary__c, 2)) <> 0 && CONTAINS(MID( Wedding_Anniversary__c, 1, 5),'/'))) && 
NOT (ISBLANK (Wedding_Anniversary__c))

Can anyone please assist me?


Thanks,

Vimal
Steve :-/Steve :-/

I would seriously push back on this "requirement" this is going to lead to all kinda of problems with data quaility.  Have them pick 1 format and work with that.

Andray GaustAndray Gaust
I also got in trouble while making wedding invitation template (https://www.invitanku.com/) on online tool for invitation maker. But thanks to the admin of website who help me and solve my issue.