A Quote Calculator Plugin (QCP) is needed in order to accomplish this use case. Using JSForce, a query can pull the correct pricing data when called.
A basic example of how to set up the pricing can be found below, where QCP_Lookup_Table__c is the Object from which the pricing is queried, and fields Partner_Discount__c (Percent) and ProductId__c (text) are on the QCP Lookup Table object. The Custom Script record's Code field contains the following text and sets the Quote Line's Partner Discount field based on Quote Line matching the Product Id field on the Lookup Table.
export function onBeforeCalculate(quote, lines, conn){
if(lines.length > 0){
var productIds = [];
lines.forEach(function(line) {
if(line.record['SBQQ__Product__c']){
productIds.push(line.record['SBQQ__Product__c']);
}
});
if (productIds.length){
var productIdList = "('" + productIds.join("', '") + "')";
var queryString = 'SELECT Id, Partner_Discount__c, ProductId__c FROM QCP_Lookup_Table__c WHERE ProductId__c IN ';
queryString += productIdList;
return conn.query(queryString)
.then(function(results){
if (results.totalSize){
var discByProduct = {};
results.records.forEach(function(record){
discByProduct[record.ProductId__c] = record.Partner_Discount__c;
});
lines.forEach(function(line){
if(line.record['SBQQ__Product__c']){
line.record['SBQQ__PartnerDiscount__c'] = discByProduct[line.record['SBQQ__Product__c']] || '';
}
});
}
});
}
}
return Promise.resolve();
} 000380849

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.