Skip to content

Utility that makes a CPQ quote have the same shares as its related opportunity

Notifications You must be signed in to change notification settings

dmgerow/cpq-quote-share-sync

Repository files navigation

CPQ Quote Share Sync

This repo contains a service class that can be used to mirror Opportunity shares granted both on the opportunity and the opportunity's parent account to the quote.

This should be used in situations where you would like a quote to get its shares from the opportunity as it would through a master-detail relationship with the opportunity.

Org Installation Notes

  1. Make sure that the account, opportunity, and quote access is set to private or read only

  2. Deploy to Salesforce
  3. Call the CPQ_QuoteShareService from your triggers, batch jobs, etc.

CPQ_QuoteShareService.syncQuoteAccessFromAccountAndOpportunity(quoteList); //where quoteList is a list of quotes
  1. Update the test class to make sure that it passes in your org

Implementation Considerations

  • This should be implemented in triggers very sparingly. Calling it from any trigger except the quote will put you at risk of hitting governor limits.
  • Consider creating a scheduled batch job to call this code so that sharing is recalculated for quotes in a specific criteria. The code only creates or deletes shares if the change is required, so you should not have to worry about locking quotes while people are working on them or other unnecessary database activity.
  • Test this a lot before using it in production

Scratch Org Notes

First, make sure that all of the npm modules are installed

npm install

Then, you can make a scratch org with CPQ installed using the following command:

npm run crate:scratch

About

Utility that makes a CPQ quote have the same shares as its related opportunity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published