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
DeafForceDeafForce 

Count of Opportunity Line Item Schedule Records Required

Hi everyone,

I actually thought it`s an easy enough to solve requirement but I somehow can`t manage to get it done....Here we go..

All I need is the number of the quantity/revenue schedules attached to an opportunity line item. We set up schedules on a monthly basis. So if a quantity schedule has been set up from Jan - March, then it should return 3. If Jan - June, then 6 etc etc

I can easily view this number in a report but I need it as a physical value on the opp line item in order to set up further calculations.

I know there is an option to create a trigger on the opportunitylineitem object and the opportunitylineitemschedule can be queried within it but unfortunately I am too familiar with the whole apex stuff.

If there is an easier option than using apex, then even better.

Could someone guide me in the right direction on how to achieve this ?

Any help is very much appreciated!
Thanks and have a good day,
Christian
 
Best Answer chosen by DeafForce
DeafForceDeafForce
I should have checked more posts......Found the solution here:

https://developer.salesforce.com/forums?id=906F00000008xsUIAQ

Credit to bob_buzzard !

Thanks,
Christian

All Answers

lakslaks
Hi Christian,

What is the relationship between opportunitylineitem object and the opportunitylineitemschedule object in your org ?
Is it a master detail relationship ? If so, you can create a Roll-up summary field on the master object.

You can check out about Roll-up summary fields here - https://help.salesforce.com/HTViewHelpDoc?id=fields_about_roll_up_summary_fields.htm&language=en_US

Hope this helps.

Regards,
Lakshmi.

 
DeafForceDeafForce
Hi Lakshmi,

Thanks for your response.

These are all standard objects. SF doesn`t allow roll up summary fields to be created on the opportunity line item (aka opp product) object and the relationship cannot be changed either.

Got any other advice ? :/

Thanks,
Christian
DeafForceDeafForce
I should have checked more posts......Found the solution here:

https://developer.salesforce.com/forums?id=906F00000008xsUIAQ

Credit to bob_buzzard !

Thanks,
Christian
This was selected as the best answer