- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
11-08-2012 01:00 AM
11-08-2012 03:48 AM
Somewhat complex to achieve but not impossible .
You better add a Date picklist along with Month and year .
Then Add a formula field(suppose X) which concatenates Year ,month and date according to picklists .You may hide this field from page layout.
Now use DATEVALUE(X) function to find the date and compare that with TODAY() .
Try this and let me know if it working or not.
11-08-2012 07:40 AM
A better solution might be to just have a date field that they fill in. Then a validation rule that makes sure that date is last month. The formula could be
YEAR( Attended_Date__c ) <> YEAR ( TODAY() ),
MONTH( Attended_Date__c ) <> MONTH ( TODAY() ) - 1
Then if you want the month and year fields to be pulled out for some other purpose, create formula fields for that like below.
MONTH( DATEVALUE(Attended_Date__c) )
YEAR( DATEVALUE(Attended_Date__c) )