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
Pushkar GuptaPushkar Gupta 

Hello guys, can anyone help me with this

we have to add a discount on the product on account for this you need to create 5 fields Tier1 to 5 on account in which you can specify the discount % Also,create one picklist on product with values Tier 1 to tier 5 to select Tier. When a new product is added with Tier value under opp then the discount will be applicable only when tier is mentioned on product and Discount for that Tier is mentioned on Account.
Saifullah SaifiSaifullah Saifi
IF(TEXT(PricebookEntry.Product2.Tier__c) <> NULL , 
IF(ISPICKVAL(PricebookEntry.Product2.Tier__c,"Tier 1"), 
IF(NOT(ISNULL(Opportunity.Account.Tier_1__c)),Opportunity.Account.Tier_1__c,0), 
IF(ISPICKVAL(PricebookEntry.Product2.Tier__c,"Tier 2"), 
IF(NOT(ISNULL(Opportunity.Account.Tier_2__c)),Opportunity.Account.Tier_2__c,0), 
IF(ISPICKVAL(PricebookEntry.Product2.Tier__c,"Tier 3"), 
IF(NOT(ISNULL(Opportunity.Account.Tier_3__c)),Opportunity.Account.Tier_3__c,0), 
IF(ISPICKVAL(PricebookEntry.Product2.Tier__c,"Tier 4"), 
IF(NOT(ISNULL(Opportunity.Account.Tier_4__c)),Opportunity.Account.Tier_4__c,0), 
IF(NOT(ISNULL(Opportunity.Account.Tier_5__c)),Opportunity.Account.Tier_5__c,0) 
) 
) 
) 
), 
0)

Make a formula field in Opportunit Product with Return type percent

Paste this code into it

Please remember , I created a picklist in procuct with APi name Tier__c and value Tier 1, Tier 2, Tier 3, Tier 4. Tier 5
and 5 fields in Account of % type Tier_1__c,Tier_2__c,Tier_3__c,Tier_4__c,Tier_5__c