Hi everyone,
I need to perform a bulk security update to grant visibility over thousands of existing historical Quote records in our system.
The Setup:
- OWD: Account and Quote objects are both set to Private.
- We use the "Create Quotes Without Opportunity" feature, so thousands of existing integrated Quotes are linked to Accounts via the standard QuoteAccountId field.
- Field agents are assigned to Regional Public Groups (e.g., OutsideSalesSpain, OutsideSalesFrance, etc.) matching their specific company/region field value (Spain, France, etc.).
The Requirement:
I need to run a one-time bulk update to grant
Read access over all existing historical Quotes to the Account Owner of the Account associated with those quotes, but ONLY if that Account Owner belongs to the corresponding Regional Public Group, and ONLYif the Quote's region matches the Account's region.
I already created a flow to handle this when quotes are being created, but the flow does not handle this visibility when there already exist Quote records in Salesforce.
If I use Data Loader to solve this for historical Quote records, the solution would take long and would be cumbersome (probably manual efforts). Is this possible to solve with Apex?. We are talking about more than 20000 existing Quote records!.
Thanks for your advice!
@Salesforce Administrators & Developers, @Salesforce Administrators and Developers, @APAC Architects, @Data Quality & Management, @Ladies Be Architects
#Trailhead Challenges #Salesforce Developer #Salesforce Admin #Data Management
Hi @Lena Wong
A Schedule-Triggered Flow could process the Quotes in batches, but for this specific requirement I’d still prefer Batch Apex.
Since we need to check Public Group membership + Region matching and create QuoteShare records for 20,000+ historical Quotes, Batch Apex provides better control over bulk processing, error handling, and sharing logic.
So I’d use Batch Apex for the one-time backfill, and keep your existing Flow for newly created Quotes.
https://help.salesforce.com/s/articleView?id=platform.flow_considerations_trigger_schedule.htm&type=5&utmThanks.