Skip to main content

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 ONLY

if 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

3 Antworten
  1. Gestern 17:07

    Hi @Lena Wong

     

    Yes, this is possible with Batch Apex and would be more suitable than Data Loader for 20,000+ existing Quotes.

    • Query Quotes in batches and get the related Account Owner and Region.
    • Verify the Account Owner is a member of the corresponding Regional Public Group.
    • Check that Quote Region = Account Region.
    • For matching records, create QuoteShare records with Read access.
    • Handle existing share records/duplicates and test the batch in a sandbox first.

    Batch Apex + programmatic sharing would be my recommended approach for this one-time historical data update.  

      

    If this helps resolve your issue, please consider marking it as the Accepted Answer so it can help other Trailblazers as well. Thanks! 

0/9000