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

calculating the days based on quarterly wise.

Hi all ,

      I have one object called Leaves.This object contains fields like fromdate(date),todate(date),employee(lookup of employee object.)First time create the record in leaves object successfully.In this no of days as formula field like as follows.Noofdays=todate-fromdate+1 and Noofavailableleaves  like as follows,Noofavailabledays=12-noofdays.It works fine.


first time,






                       It works fine.


Second time when i try to create record with same employee,Then  i want the values like this in formula fields.




No.of.available leaves=10-2=8Because in the previous record the same employee is created and this emaployee contains noofavailableleavs is time i want to display the value vaue based on the first created record



Problem:But in the second time also display  the No.of.available leaves as 10.How to fix this.i hope it would be clear. Any one can u please help me.


Thanks in advance.





Instead of Formula field, why not write a small trigger to update No of available leaves Field? .Through trigger you can find the existing value of this field for given employee and can do required calculation on this value