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
econ242econ242 

Opportunity workflow and Stage updates

Hi everyone...

Looking for some help with opportunities here... My company has never used opportunities and I believe they need to, and my experience is minimal with opportunities because of this, so this (Opportunities) is slightly new to me as well, but here is the scenario...

Currently, we track customer orders via a custom object called Shipments...these are quantity based with no dollar value associated. I also have many roll-up sommary fields on the Account record that tracks total orders for the current month to gauge the volume of business received from the customer. The previous business days' orders are automatically uploaded each morning to the shipment custom object which in turn update the roll-up custom fields daily.

I've added the Shipments related list to the Opportunity page layout and have created a few roll-up custom summary fields to capture the amount of orders received on the opportunity, i also have a Quantity field that the Sales Team needs to populate with the number of orders they anticipate from the customer for this particular opportunity...my question here is, is there a formula or workflow rule that can accomplish the following - when the number of orders received matches the quantity value (i.e., orders received = 10 and Quantity = 10) can I automatically update the opportunity Stage to "Closed/Won" and automatically close the opportunity for that Account?

Can a WFR do this, or do I need a trigger? if a WFR is possible...any help in setting up would be most apprecaited...thanks and sorry for the novel, lol!!!
 
Gary PayneGary Payne
Yes, you could create a worflow rule that uses an IF statement in the Rule Criteria (formula evaluates to true) to trigger the WFR:  
IF(Orders_Received__c >= Quantity__c,True,False).  Add an Update action type to the WFR to change the Opportunity Stage to "Closed/Won". You will want to set the Evaluation Criteria to "created, and any time it’s edited to subsequently meet criteria".  Hope this works for you.
econ242econ242
Strangely it's not working...when I add the order the the Shipment related list, the roll-up summary field that tracks the orders updates as it should, but the stage does not change...any thoughts?
Gary PayneGary Payne
You may want to add an ISCHANGED formula to the WFR Criteria: ISCHANGED(Orders_Received__c) Use the AND function so both the IF formula and ISCHANGED formula must be true to trigger the WFR to fire. AND(ISCHANGED(Orders_Received__c),IF(Orders_Received__c >= Quantity__c,True,False)) Gary Payne, CRM Administrator/Information Technology SWBC 9311 San Pedro Ave., Suite 600 San Antonio, TX 78216 888-391-6707 - Toll Free/ Help Desk 210-376-6057 - Direct 714-474-5915 - Mobile 210-468-4135 - Fax [cid:image001.png@01CFF9CD.AEC19D90] Visit our website at www.swbc.com [Description: Description: Description: Description: Description: Description: Description: Description: Description: swbc-iphone-logo28] [Description: Description: Description: Description: Description: facebook-official-28px] [Description: Description: Description: Description: Description: linkedIn-official-28px] [Description: Description: Description: Description: Description: youTube-sm]
econ242econ242
Thanks Gary!!!

Still not working however...now I get this - Error: Function ISCHANGED may not be used in this type of formula...
???
 
econ242econ242
It's not working because the Orders_Received__c is a formula field...my bad!!! I couldn't use a roll-up summary on the opportunity object for this related list object so I had to reference a field on the Account record that tracks the same data...

i didn't think this would be so difficult...especially for something that seems so elementary...

Back to the drawing board on this one then...I really don't want to use a trigger!!!