+ Start a Discussion
Cassandra GeskeCassandra Geske 

Update Custom Field

What im trying to do: I have a custom field called "Total Potential Contract Amount". This field is a formula field which is driven by the sum of the all the Manual FYXX Revenue fields (which by their name are manually entered). I am trying to get the Amount field (which is native to Salesforce) to be automatically updated by the Total Potential Contract Amount Field any time the TPCA value changes or is updated. 

What I currently have implemented (but is not working properly): 
  • A work flow rule that will auto-update the Amount field with the "Total Potential Contract Amount" value based on the following criteria:
    • Rule Criteria: (Opportunity: Opportunity NameNOT EQUAL TOnull) 
  • The Immediate Workflow actions are driven by a field update indicating the following detail:
    • Name: Auto-Update Amount with Total Potential  
    • Unique Name: Auto_Update_Amount_with_Total_Potential  
    • Description: This filed update will auto-update the "Amount" (hidden) field with the manually entered "Total Potential Contract Value"
    • Object: Opportunity  
    • Field to Update: Opportunity: Amount
    • Field Data Type: Currency
    • Formula Value: Total_Contract_Amount__c
  • The rules using this field update are as follows (same as above):
    • Evaluate the rule when a record is: created, and any time it's edited to subsequently meet criteria
    • And when the following criteria are met:
      • Opportunity: Opportunity Name not equal to "blank" - as this is a required field to create an opportunity
I dont think that having that criteria is adequate to update a field from a custom field. I am thinking an Apex trigger might be a better solution? Have the TPCA field update the Amount field any time the TPCA is changed or updated by a SF user. Thoughts? Thanks in advance!

 
Best Answer chosen by Cassandra Geske
Vivek DVivek D
Hi 
You cannot add time-dependent workflow actions with this option it is not an error it is just a info message that you cannot add time dependent actions which is fine because I guess you are not adding any time dependent actions.
Regarding Missing ')' as you said you removed OR so that might be the issue. Check your formula should be in proper squence and evething should be closed
OR
(
	ISCHANGED(),
    ISCHANGED(),
	ISCHANGED()  
)


 

All Answers

Vivek DVivek D
In workflow criteria use formula evaluates to true and put all the revenue generating field which are contributing to the total or TPCA
For example: -
OR( 
   ISCHANGED(Field1),
   ISCHANGED(Field2),
   ISCHANGED(Field3),
   ISCHANGED(Field4),
...
...
)
If the formula is true update amount with TCPA. Hope that will solve your problem :)
 
Cassandra GeskeCassandra Geske
Thanks Vivek - thanks for your quick response!

So two things:
I utilized the formula above and replaced your "Field1, etc) with my Revenue fields that are attributing the formula of TPCA: 

OR(
ISCHANGED(FY16_Revenue__c),
ISCHANGED(FY17_Revenue__c),
ISCHANGED(FY18_Revenue__c),
ISCHANGED(FY19_Revenue__c),
ISCHANGED(FY20_Revenue__c)
)

When I did that, it returned the error: Error: Function ISCHANGED may not be used in this type of formula

So I removed the "OR" and just had the open parentheses. When I did that, it returned the error: Error: Syntax error. Missing ')'. I have all of my parentheses matching up, so not sure where it thinks one is missing. 

Any thoughts on what might not be working? Appreciate your continued help!
Vivek DVivek D
Hi Cassandra,
ISCHANGED will only work when the evaluation criteria for workflow is set to Evaluate the rule when a record is: created, and every time it’s edited.
 
Cassandra GeskeCassandra Geske
Hi Vivek,
I did change that and it gives me this error: You cannot add time-dependent workflow actions with this option.

And even then, the error of: Error: Syntax error. Missing ')' is still an issue. 
Vivek DVivek D
Hi 
You cannot add time-dependent workflow actions with this option it is not an error it is just a info message that you cannot add time dependent actions which is fine because I guess you are not adding any time dependent actions.
Regarding Missing ')' as you said you removed OR so that might be the issue. Check your formula should be in proper squence and evething should be closed
OR
(
	ISCHANGED(),
    ISCHANGED(),
	ISCHANGED()  
)


 
This was selected as the best answer
Cassandra GeskeCassandra Geske
BAM!!!!! Vivek - thank you for sticking through this to help me outh. Appreicate your guidance in making this happen!!!
Vivek DVivek D
You are weclome. Please choose Best Answer if that helped.