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
kurtz_wolfgangkurtz_wolfgang 

Opportunity Product Schedules

Hello Everybody,

 

   Currently I am facing a very weird problem. Here goes the description:

 

I converted a lead to create an opportunity. One of the field is CloseDate with value as 9/30/2012. The product added to the opportunity has a quarterly schedule. A field called BookedDate contains today's date i.e. 8/17/2012. Opportunity stage is 5- Closed Won.

 

Now by virtue of a trigger, the schedules should be generated starting from 9/30/2012, however when the CloseDate is updated to today's date and quarterly schedules are generated off today's date, and then again the CloseDate is assigned 9/30/2012 by virtue of a Field Update.

 

The Opportunity  history shows two entries:

1st) CloseDate changed from 9/30 to 8/17.

2nd) CloseDate changed from 8/17 to 9/30.

 

Now the most confusing part is the trigger :

It first generates the schedules from 8/17, however due to the update from 8/17 to 9/30 on CloseDate on Opportunity, its logic is not executed. I put a debug log and what it shows for that instance is that the Trigger.new and Trigger.old CloseDate  are the same, which is not true since Old Close Date is 8/17 and New CloseDate is 9/30, but debug log shows New and Old CloseDate as 9/30.

 

The problem is so confusing that it's difficult to express it right away. Any suggestion would be very helpful.

 

Thanks a lot.

K

Best Answer chosen by Admin (Salesforce Developers) 
kurtz_wolfgangkurtz_wolfgang

Hi Daniel,

 

  Just as an update, Salesforce informed us that it is just that way the Salesforce functionality works and there is no way to prevent that.

 

Thanks for your help though,

K

All Answers

Daniel.ReidDaniel.Reid

Hello,

 

That does sound perplexing.  Is it possible for you to post the code for the trigger?  It will likely make the problem much easier to diagnose and fix.

 

Daniel Reid
Contact us - We can help!

Salesforce Superheroes
------------------------------
help@salesforcesuperheroes.com
www.salesforcesuperheroes.com
1-888-407-9578 x102

kurtz_wolfgangkurtz_wolfgang

Sorry Daniel for the late response. We have submitted the issue with Salesforce for a month and waiting for the resolution.

kurtz_wolfgangkurtz_wolfgang

Hi Daniel,

 

  Just as an update, Salesforce informed us that it is just that way the Salesforce functionality works and there is no way to prevent that.

 

Thanks for your help though,

K

This was selected as the best answer