• Ravi Gupta 15
  • NEWBIE
  • 5 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi frnz, I need a logic for below situation in TRIGGER.

** VA is a parent object which has Cancellation as Child that has three records with 'start date' and 'end date' fields.
We need to calculate total days between Start date and End date in three records, then store it in VA.

** Now if those three records have any Overlapping days, we should not count that. For Example.......

Record1 - start date = jul 01 2015, end date = Jul 31 2015  = 31 days
Record2 - start date = Jul 10 2015, end date = Jul 20 2015  = 0 Dates were overlapped by the others
Record3 - start date = Jun 21 2014, end date = Jul 05 2015 = 10 days (Jun 21 - Jun 30, july 01 - july 05 overlapped by the others)
Record4 - start date = Jun 01 2014, end date = Jun 05 2014 = 5 days
total of 46 days

How to achieve this?
Thanks. :))
 
Hi frnz, I need a logic for below situation in TRIGGER.

** VA is a parent object which has Cancellation as Child that has three records with 'start date' and 'end date' fields.
We need to calculate total days between Start date and End date in three records, then store it in VA.

** Now if those three records have any Overlapping days, we should not count that. For Example.......

Record1 - start date = jul 01 2015, end date = Jul 31 2015  = 31 days
Record2 - start date = Jul 10 2015, end date = Jul 20 2015  = 0 Dates were overlapped by the others
Record3 - start date = Jun 21 2014, end date = Jul 05 2015 = 10 days (Jun 21 - Jun 30, july 01 - july 05 overlapped by the others)
Record4 - start date = Jun 01 2014, end date = Jun 05 2014 = 5 days
total of 46 days

How to achieve this?
Thanks. :))