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

Apec trigger on product scheduling


I am new to apex. I have enabled product scheduling for opportunities. I have created another object where I want to populate the schedule amount and the date.


Can anyone please tell me how can I do this. I have a date field & amount filed on the new object [ Revenue Schedule] . All i want to do is write the revenue schedule amount to amount  & Schedule date to date.


PLease suggest.



dotnet developedotnet develope



Write a trigger on opportunity of after insert / after update event.


where you can query on "schedule" object  to fetch the amount and date with respect to opportunityID.


I hope it help you to solve ur requirement.




Can you please explain more. How will i be able to access schedule from opportunity?




nasir jawednasir jawed

Hi Shirin,


Trigger updateRevenueSchedule on Opportunity(after insert ,after update)


Opportunity o = new Opportunity();

o = [Select Amount, date from Opportunity where "write how u want to filter"]



RevenueSchedule r = new RevenueSchedule();

r.amount = opp.amount;;

insert r;



This is how u can update the value from one object to another object.Just change the object name and syntex and this would work.



nasir jawednasir jawed

Hi Shirin,



You can also achieve this by writing a WORKFLOW by using field update.That would be easier and saleforce provide this.Try to achieve this by using workflow first.


if any of my provide solution works please check a tick mark so that other who face the similar problem can use it.




Nasir Jawed