+ Start a Discussion
uuuu 

Please help me!

Hii developers,
Please guide me how to do this.
I want to calcualate Total leave for employee.
On Employee__c object i have custom fields Join_date__c, Total_Allocated_Leaves__c,Taken_Leaves__c, 
Remain_Leaves__c(Total_Allocated_Leaves__c-Taken_Leaves)

In general total Leaves are 18 Leaves per year
so that for one month it is 1.5 Leave

But if employee has join_date__c=11-june-2020.
then calculates it (1.5*20)/30=1
here 20 is the number of days he worked in june month and 30 is the total days in june month.
so the overall Leaves for the employee is[18-(1.5-1)]=17 Leaves.

after the one year it will updates the Total_Allocated_Leaves__c with 21+Remain_Leaves__c.

Please help me how to do this!
Thank you.

Regards,
Anita Sodhi

 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Anita,

Have you implemented the use case and are you facing any issue?

Regards,
Anutej