Authored by Zishan Razzaq

Wednesday, January 20, 2010

Event within 10 days in salesforce.com

Scenario:
     Want to know if there is an event within 10 days of the event.
On any Object:
Create a formula field.
Field Type= Text

The formula is:
IF(
MONTH(DateFieldName)=MONTH(TODAY()),
IF(
AND(
DAY(DateFieldName)-DAY(TODAY())>=0,
DAY(DateFieldName)-DAY(TODAY())<=10
),
"TRUE",
"FALSE"
),
IF(MONTH(DateFieldName)-MONTH(TODAY())=1,
IF(
AND(
31-DAY(TODAY())+DAY(DateFieldName)>=0,
31-DAY(TODAY())+DAY(DateFieldName)<=10
),
"TRUE",
"FALSE"
),
"FALSE"
)
)

Thank you
Check out my Other Blogs:

VisualForce Made Easy
Data Migration Made Easy
eTechCareers.com  Coming Soon!!!! All of your Employment needs for Information Technology and Project Management.
LINKS: