You need to sign in to do that
Don't have an account?
![Gator Gator](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Trigger Insert/Update CustomObject Record upon OpportunityLineItemSchedule changes
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...
Anyone? Could REALLY use some advice here.... Thanks in advance.
basically what you need is not possible. Cannot set a trigger from a schedule.
I have had HUGE problems with the schedules part lately. Trying to insert but hit soql limits and also cannot update current record, etc. Any help?
This is current code:-