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
emorylemoryl 

Opportunity Custom Field Formula

I have a custom field - data type Number - the default value i would like the product of two values A*B=Custom_Field

 

The formula is below

 

Amount*2

 

Yields this error.

 

Error: Field Amount may not be used in this type of formula

 

Thank you for your help

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Hi emoryl, 

 

It looks like your you're trying to do is shove a Formula into the Default Value box of a datatype(Number) field.  That won't work.  

 

What you need to do is create a new custom field and select Formula(Number) as the datatype.  

Then enter your formula in the box provided with the appropriate Fields and Functions.  

 

Another option if you are on EE or UE would be to create a Workflow Rule with a Field Update.  Now that does have the ability to update a datatype(Number) field with the reult of a formula.

All Answers

Monika BhardwajMonika Bhardwaj

Dear Emoryl,

 

To get the default value as product of your two existing fields .

Please edit your Amount field as Formula type reason being , that

Amount field will contain floating values as well.

 

Then in the "Default Value" Area ... use the API names of those respective fields of whom you want

to get product displayed.

 

Kindly mark done , if this solution works for you

 

Thanks....

Monica

Steve :-/Steve :-/

Hi emoryl, 

 

It looks like your you're trying to do is shove a Formula into the Default Value box of a datatype(Number) field.  That won't work.  

 

What you need to do is create a new custom field and select Formula(Number) as the datatype.  

Then enter your formula in the box provided with the appropriate Fields and Functions.  

 

Another option if you are on EE or UE would be to create a Workflow Rule with a Field Update.  Now that does have the ability to update a datatype(Number) field with the reult of a formula.

This was selected as the best answer