+ Start a Discussion
The new LearnerThe new Learner 

How to calculate the date of current week

Hi Experts,

I need to calculate the Date of current week in apex class, i have two fields preferred date and WeekDate field , eg: when  'Preferred Day(picklist list field)” = Monday so i need to set to the date for the "WeekDate" field  to  Monday of this week like wise i need to do till friday. if Preferred Day value is none then i need to populate todays date for the WeekDate field.

Thanks indavance
This is tricky though. What happens if user changes the weekday after few months of creation of record. It would be challenging to auto populate a date for that weekday. However, you can other way if you would like. Auto populating weekday based on date.

check this out: https://success.salesforce.com/answers?id=90630000000h1oXAAQ
The new LearnerThe new Learner
He can't change that date, can you provide me that logic pls