• vaishnavi Sonavane 1
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hello

I have 2 custom object with master detail relationship.
Monthly_Plan__c(Master) and Weekly-Plan__c(Child).

1.Monthly_Plan__c Object have Start_Date__c field
2.Weekly-Plan__c Object have Start_Date__c field and End_Date__c field 

For example : If I select Start_Date__c field of Monthly_Plan__c Object as 1/07/2018(1/july/2018) then my trigger should create 5 child records for the Weekly-Plan__c Object because July month have 5 weeks.

for example
My first record should be for first week of the month 
i.e 
   Start_Date__c should be 1/07/2018
&  End_Date__c Should be 7/07/2018

Similarly,
My second record should be for Second week of the month 
i.e 
   Start_Date__c should be 8/07/2018
​&  End_Date__c Should be 14/07/2018

and so on.