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
abhilash reddy 30abhilash reddy 30 

How to allot number of hours to Project Start Date and End date?

I am New to Salesforce,I don't Know How to Complete Below Trigger Scenario...PLZ help me to Complete below scenario...i will be highly oweful to you..


My Trigger Scenario:I have a object called "Project" having below Fields.
       ---->Project Name
       ---->Project Start Date
       ---->Project End Date
       ---->Total NO.of Hours( default value 100 hours )
       ---->Project Ratio(Picklist Data Type) having below values(Interms of Hours)
                --> 100-1
                --> 70-30    
                --> 50-50
                --> 30-70
                --> 0-100
Requirement:
------------
   If user selects Project Start Date And Project End Date,For Example User Select 2-3-2017 as Project Start Date and 20-9-2017 as Project End Date  and
       -->if user select "100-1" from picklist,total 100 hours(before Hyphen value) should be alloted to Project Start Date i.e "March" in this case.
       -->if user select "70-30" from picklist, 70 hours(before Hyphen value) should be alloted to Project Start Date i.e "March" in this case, remaining 30 Hours(after Hyphen Value) should be alloted to remaining months(In my case April,may,june,july,August,sep),we have to consider number of days in each month as well.
       -->if user select "50-50" from picklist, 50 hours(before Hyphen value) should be alloted to Project Start Date i.e "March" in this case, remaining 50 Hours(after Hyphen Value) should be alloted to remaining months(In my case April,may,june,july,August,sep),we have to consider number of days in each month as well.
       -->if user select "30-70" from picklist, 30 hours(before Hyphen value) should be alloted to Project Start Date i.e "March" in this case, remaining 70 Hours(after Hyphen Value) should be alloted to remaining months(In my case April,may,june,july,August,sep),we have to consider number of days in each month as well.
       -->if user select "0-100" from picklist,total 100 hours(After Hyphen value) should be alloted to Project End Date i.e "March" in this case.
After Completion of Above Requirement every Project Record should have a related list with below records:
       -->In Case Of "100-1" pick list Selection
           Record 1:March-100
           Record 2:April-0
           Record 3:May-0
           Record 4:June-0
           Record 5:July-0
           Record 6:AUgust-0
           Record 7:September-0

       -->In Case Of "30-70" pick list Selection
           Record 1:March-30
           For Remaining six records,70 hours should be devided to remaining Months ,we have to consider number of days in each month as well.
 
--------->Continue the above process for Remaing Pick List Selecton values As well.