• frido
  • NEWBIE
  • 0 Points
  • Member since 2013

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

End goal is to have a report type that includes the following data-

- Opportunity info

- info from a custom object underneath the opportunity called CustomObjectUnderOpportunity (master-detail relationship with opportunity)

- info from all OpportunityLineItemSchedules under that opportunity

 

 

I believe I need a trigger to make a new object -- Let's call it CustomLineItemSchedule -- that can create a record for each combination.

 ie: 2 custom object records under opp, 3 opportunitylineitemschedules = 6 new link objects created

 

Problem Part 1:

I'm trying to extract the Revenue and ScheduleDate fields from any OpportunityLineItemSchedule record that is created/changed/deleted and drop those values into two fields in CustomLineItemSchedule.

 

I'm aware that you cannot run a trigger directly off of the OpportunityLineItemSchedule, but I believe there is a way to do this by comparing the LastModifiedDate of each OpportunityLineItemSchedule record against the OpportunityLineItem.LastModifiedDate.

 

Part 2: 

Trigger does some combinatorics to create 2*3= 6 new CustomLineItemSchedule records rather than just 3 (one for each opportunitylineitemschedule).  Trigger would have to put a couple fields from the CustomObjectUnderOpportunity record into the new object.

 

 

This allows me to create an 'Opportunity and CustomLineItemSchedule' report with all the fields I need.

 

Does anyone have any suggestions?  GREATLY appreciated. Hope this was explained well...

  • January 18, 2013
  • Like
  • 0