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
billkatbillkat 

Calculating a price, formula troubles...

Hi all,

Delving into formulas for the first time and having trouble. We have a List Price field, on a custom object, and a 'Customer Price' field. What I want to do in essence is:

"if customer price field is empty, calculate it (e.g. list price * 0.9), else do nothing"

 

I've tried putting a formula in the Customer Price, but get "Error: Formula cannot use another formula field that directly or indirectly refers to itself". Tried this below as a start point (not sure how to "do nothing" in an IF() as well:

 

IF (
ISBLANK(Customer_Price__c),
Customer_Price__c = List_Price__c * 0.9,
Customer_Price__c = Customer_Price__c
)

 

So then I tried putting a formula on the List Price field instead. But there I get an error "field may not be used in this type of formula" ...

 

Any ideas? Any help would be appreciated, cheers.

Ispita_NavatarIspita_Navatar

Try the following:-

 

IF (ISBLANK(Customer_Price__c), Customer_Price__c = List_Price__c * 0.9, Customer_Price__c = 0.0)

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

 

billkatbillkat

Thanks Ispita. I tried it by applying it to the List Price field, I hope this is the right approach.

I tried it against a number firld and a currency field, just in case it mattered.

For both I get: "Error: Field myfield__c may not be used in this type of formula"

 

Regards

Bill

Ispita_NavatarIspita_Navatar

 What is the datatype of this field??

billkatbillkat

List Price is Number(16, 2)
I tried putting formulas in that field to act against fields of types Number(7, 2)   and   Currency(7, 2)

Both gave 'Field x may not be used in this type of formula'

Ispita_NavatarIspita_Navatar

In case the field is of the type number then you can try using ISNULL(fieldname).

 

Hope this helps.

billkatbillkat

Still get the same I'm afraid. I think I'll call in someone else to have a look, there must be something I'm doing wrong.

Many thanks for your help Ispita, much appreciated -

 

cheers

Bill