Skip to main content
added 21 characters in body
Source Link
EricSSH
  • 4.3k
  • 1
  • 29
  • 59

I have a leave__cLeave__c as a custom object. It contains 3 fields: Employee Name (lookup to User), Leave Start Date (Date) and Leave End Date (Date). Example: User "John" is on leave from Start Date "4th Jan 2018" to End Date "12th Jan 2018". Like wise there can be multiple leave records for different users. I want to generate a apex logic such that for month of January (1st Jan to 31t Jan 2018), weekwise how many users are on leave. I want to displa this info in VF Page in table format for reporting purpose.

So I am planning to create a wrapper as below:

dateWiseWrapper{ Date leaveDate; Boolean isOnLeave; }

weekWiseWrapper{ Integer weekNumber; Integer NumberofLeaves; List //Max 7 days }

UserWrapper{ User u; List; //Max 4 weeks }

UserWeekwiseResultWrapper{ List userWrapperList; }

dateWiseWrapper{
    Date leaveDate;
    Boolean isOnLeave;
}

weekWiseWrapper{
    Integer weekNumber;
    Integer NumberofLeaves;
    List<DateWiseWrapper> //Max 7 days
}

UserWrapper{
    User u;
    List<weekWiseWrapper>; //Max 4 weeks
}

UserWeekwiseResultWrapper{
    List<UserWrapper> userWrapperList;
}

Does my wrapper looks correct? Can you please help me out on how do I proceed with the apex logic

I have a leave__c as a custom object. It contains 3 fields: Employee Name (lookup to User), Leave Start Date (Date) and Leave End Date (Date). Example: User "John" is on leave from Start Date "4th Jan 2018" to End Date "12th Jan 2018". Like wise there can be multiple leave records for different users. I want to generate a apex logic such that for month of January (1st Jan to 31t Jan 2018), weekwise how many users are on leave. I want to displa this info in VF Page in table format for reporting purpose.

So I am planning to create a wrapper as below:

dateWiseWrapper{ Date leaveDate; Boolean isOnLeave; }

weekWiseWrapper{ Integer weekNumber; Integer NumberofLeaves; List //Max 7 days }

UserWrapper{ User u; List; //Max 4 weeks }

UserWeekwiseResultWrapper{ List userWrapperList; }

Does my wrapper looks correct? Can you please help me out on how do I proceed with the apex logic

I have a Leave__c as a custom object. It contains 3 fields: Employee Name (lookup to User), Leave Start Date (Date) and Leave End Date (Date). Example: User "John" is on leave from Start Date "4th Jan 2018" to End Date "12th Jan 2018". Like wise there can be multiple leave records for different users. I want to generate a apex logic such that for month of January (1st Jan to 31t Jan 2018), weekwise how many users are on leave. I want to displa this info in VF Page in table format for reporting purpose.

So I am planning to create a wrapper as below:

dateWiseWrapper{
    Date leaveDate;
    Boolean isOnLeave;
}

weekWiseWrapper{
    Integer weekNumber;
    Integer NumberofLeaves;
    List<DateWiseWrapper> //Max 7 days
}

UserWrapper{
    User u;
    List<weekWiseWrapper>; //Max 4 weeks
}

UserWeekwiseResultWrapper{
    List<UserWrapper> userWrapperList;
}

Does my wrapper looks correct? Can you please help me out on how do I proceed with the apex logic

Source Link
Shrey
  • 151
  • 1
  • 3
  • 10

Need Apex Logic

I have a leave__c as a custom object. It contains 3 fields: Employee Name (lookup to User), Leave Start Date (Date) and Leave End Date (Date). Example: User "John" is on leave from Start Date "4th Jan 2018" to End Date "12th Jan 2018". Like wise there can be multiple leave records for different users. I want to generate a apex logic such that for month of January (1st Jan to 31t Jan 2018), weekwise how many users are on leave. I want to displa this info in VF Page in table format for reporting purpose.

So I am planning to create a wrapper as below:

dateWiseWrapper{ Date leaveDate; Boolean isOnLeave; }

weekWiseWrapper{ Integer weekNumber; Integer NumberofLeaves; List //Max 7 days }

UserWrapper{ User u; List; //Max 4 weeks }

UserWeekwiseResultWrapper{ List userWrapperList; }

Does my wrapper looks correct? Can you please help me out on how do I proceed with the apex logic