1. Under Opportunity tab, I will go and create a new Opportunity.
  2. In the Opportunity Detail, there should be a button to add Product
  3. When adding new Product, I click the 'Establish' button under Schedule (as shown below):

enter image description here

After establishing the schedule daily, I save it and can see the view below:

enter image description here

Question : How can I establish schedules on opportunity products with daily installment period excluding weekends? As you can see the daily schedule also includes weekends which I don't want.

How I want the schedule to display for daily up to 10 days:

  • Date Quantity
  • 1/05/2017 500
  • 2/05/2017 500
  • 3/05/2017 500
  • 4/05/2017 500
  • 5/05/2017 500
  • 8/05/2017 500
  • 9/05/2017 500
  • 10/05/2017 500
  • 11/05/2017 500 (Since 6/7 May = weekend, populate 11 May)
  • 12/05/2017 500 (Since 6/7 May = weekend, populate 12 May)

I tried using Workflow rules capturing the criteria easily like so:

AND(Product2.HasQuantitySchedule = True,
Product2.HasRevenueSchedule = False,
ISPICKVAL( Product2.QuantityScheduleType , 'Divide amount into multiple installments'),
ISPICKVAL(Product2.QuantityInstallmentPeriod , 'Daily') )

but the field update cannot edit the Opportunity product schedule.

So I was thinking of using apex where I can store the variable :

private OppLineItem opplineitem = [SELECT id,ScheduleDate FROM OpportunityLineItemSchedule where type = 'quantity']

Then somehow edit/delete all ScheduleDate which are weekends into future business days. Am I on the right track or is there a better solution?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.