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
AdamHAdamH 

(Updated) Custom discount for QuoteLineItem per account

Updated:

 

Hi all,

 

I'm trying to add a custom field to my QuoteLineItem object that will look up a discount value in a custom object (Discounts) per discount code and per product category. My Discounts object is like this:

 

Discount Code, Product Category, Discount Percent

AB01, CAT, 30

AB01, EPI, 20

AB02, CAT, 15

AB02, EPI, 25

etc......

 

My Accounts object has a custom field 'Discount Code' that matches the 'Discount Code' value in my Discounts object. So, account 'Acme Inc' may have a Dicount Code = 'AB01'.

My Products object has a custom field 'Product Category' that matches one of the Prodcut Category field values. So Product A could have a Product Category = 'EPI'.

 

What I want to do is create a custom field in QuoteLineItem that will return the Discount Percent for matching Discount Code > Product Category for the account that's being quoted.

 

This is probably simple, I'm just a noob.

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers) 
SfdcStevenSfdcSteven

It's a complicated lookup to determine the tier.  You'd have to write apex code to perform the logic.

-Steven

All Answers

AdamHAdamH

Bueller.........Bueller............

SfdcStevenSfdcSteven

It's a complicated lookup to determine the tier.  You'd have to write apex code to perform the logic.

-Steven

This was selected as the best answer
AdamHAdamH

Yep, believe I've finally come to that conclusion. Thanks for the advice Steven.