+ Start a Discussion
RobKretzRobKretz 

Help with calculation

Hello! 

 

I'm trying to input a simple validation rule to calculate a gross profit number 

 

Fields are: 

Amount (Currency 16,2) 

Estimated GP %  ( percentage 16, 2) 

Gross Profit ( Currency 16,2) 

 

The rule i've tried is 

 

Amount  *  Estimated_GP__c  

 

I receive an error that states " Error: Formula result is data type (Number), incompatible with expected data type (true or false)" 

 

 

Thanks for your help in advance!! 

 

 

-Rob 

Best Answer chosen by Admin (Salesforce Developers) 
@anilbathula@@anilbathula@

Hi 

 

For gross profit you need the formula or u want to create another field and take all these into consideration.

If you want the formula field then the above  formula is working fine if not,

Please eloborate it clearly.

All Answers

@anilbathula@@anilbathula@

Hi,

 

You want a validation rule or you need a formula field for gross profit calculation?

validation rule is to validate the data in the field before saving the record.

formula fields are the output of other fields after saving the record .

which one you need in this?

 

 

 

RobKretzRobKretz

Hi Anil, 

 

I suppose a  formula field would do it.. 

 

 

@anilbathula@@anilbathula@

Hi 

 

For gross profit you need the formula or u want to create another field and take all these into consideration.

If you want the formula field then the above  formula is working fine if not,

Please eloborate it clearly.

This was selected as the best answer
RobKretzRobKretz

my goal is to have the Gross Profit field take into consideration the Amount and Estimated GP% field.. 

 

 

I have tried the formula above. I recieve an error as I stated... 

 

I am putting the formula in the Gross Profit field --- Obviously this is not working--- 

 

What do I need to do? 

 

Thanks.