// 1. CPQ+AA オブジェクト (LCO + 連動関係) を削除の階層順に定義する String[] customLCOAndDependentObjects = new String[] { 'SBQQ__QuoteLinePricingGuidance__c','SBQQ__QuoteDocument__c','SBQQ__QuoteLineConsumptionRate__c','SBQQ__QuoteLineConsumptionSchedule__c','SBQQ__QuoteLine__c','SBQQ__QuoteLineGroup__c','SBQQ__Quote__c', 'SBQQ__PricingGuidanceTier__c','SBQQ__PricingGuidance__c', 'SBQQ__ErrorCondition__c','SBQQ__ConfigurationRule__c','SBQQ__ProductAction__c','SBQQ__ProductRule__c', 'SBQQ__LookupQuery__c','SBQQ__PriceCondition__c','SBQQ__PriceAction__c','SBQQ__PriceRule__c', 'SBQQ__LineColumn__c','SBQQ__TemplateSection__c','SBQQ__QuoteTemplate__c', 'SBQQ__SubscriptionConsumptionRate__c','SBQQ__SubscriptionConsumptionSchedule__c','SBQQ__SubscribedAsset__c','SBQQ__Subscription__c', 'sbaa__ApprovalSnapshot__c','sbaa__Approval__c', 'sbaa__ApprovalCondition__c','sbaa__ApprovalRule__c' }; // 次を権限セット ID に置き換える String permSetId = ''; ObjectPermissions[] profileObjPerms; // 2.反復して削除するため 1 回のバッチではすべて完了しない for(String objName : customLCOAndDependentObjects) { // オブジェクトによってオブジェクト権限をクエリ profileObjPerms = [SELECT Id FROM ObjectPermissions where Parent.Id = :permSetId and SobjectType = :objName]; System.debug('Object perms for object:'+objName+':'+profileObjPerms.size()); try{ // 実行前に次の行をコメント解除 // delete profileObjPerms; } catch(Exception e){ System.debug('Obj perms update failed due to the follow reason: '+ e + ',' + e.getStackTraceString()); } } // 3.すべての関連オブジェクト権限の削除を確認するクエリ ObjectPermissions[] objPerms = [SELECT Id FROM ObjectPermissions where Parent.Id = :permSetId and SobjectType = :customLCOAndDependentObjects]; System.debug('Rerun Object Perm Records for CPQ & AA: '+ objPerms.size());
注: 価格ルールが SBQQ__LookupQuery__c の主オブジェクトとして定義されていない場合、上記のコードのステップ 2 で 'SBQQ__LookupQuery__c' をオブジェクトのリストから削除できます。
000394589

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.