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
ShirinShirin 

Apec trigger on product scheduling

Hi,

I am new to salesforce.com 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.

 

Thanks.

dotnet developedotnet develope

Shirin,

 

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.

 

 

ShirinShirin

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

 

 

Thanks

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"]

 

for(Opportunity opp:trigger.new){

RevenueSchedule r = new RevenueSchedule();

r.amount = opp.amount;

r.date= opp.date;

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.

 

Thanks

 

Nasir Jawed