Skip to content

Commit

Permalink
Possible fix for cpq/sbqq trigger soql error (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbianco-stripe authored Sep 29, 2022
1 parent 9d007e5 commit b716b12
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ In order for the ruby service to update Stripe ID fields, it needs to have the r

In the org, go to setup>permission sets> stripe connector integration user> manage assignments>add assignments and check your user in the org > then click assign.

## Clearing Our Test Data

Here's how to manually clear our test data. This may be fixed with `SBQQ.TriggerControl.disable()` in the delete script, can remove this later if this is the case!

```shell
sfdx force:org:open -u [email protected] -p "/lightning/setup/ImportedPackage/home" > /dev/null
sfdx force:org:open -u [email protected] -p "/lightning/setup/ImportedPackage/home" > /dev/null

# disable apex triggers

sfdx/bin/sfdx-wipe-account [email protected]
sfdx/bin/sfdx-wipe-account [email protected]
```

## Creating a stratch org

- Specify your dev hub via `sfdx force:config:set --defaultdevusername`. This can be any salesforce dev org.
Expand Down
5 changes: 5 additions & 0 deletions sfdx/bin/delete_test_record_data.apex
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ public static void deleteCPQRecordJobs() {
}
}

// https://developer.salesforce.com/docs/atlas.en-us.cpq_dev_api.meta/cpq_dev_api/cpq_api_disable_apex_triggers.htm
SBQQ.TriggerControl.disable();

deleteCPQRecordJobs();
deactivateOrderLines();
deactivateOrders();
Expand Down Expand Up @@ -268,5 +271,7 @@ for (String objectApiName : listOfObjectRecordsToDelete) {
recordsDeleted += deleteData(objectApiName);
}

SBQQ.TriggerControl.enable();

// to notify upstream caller to check if 0 were deleted
System.debug('RECORDS DELETED: ' + recordsDeleted);

0 comments on commit b716b12

Please sign in to comment.