// 1. Definir objetos CPQ+AA (LCO + dependientes) por orden jerárquico para su eliminación 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' }; // reemplazar a continuación con la identificación del conjunto permanente String permSetId = ''; ObjectPermissions[] profileObjPerms; // 2. Iterar y eliminar para que no se realice todo en 1 lote for(String objName : customLCOAndDependentObjects) { // Consulta de permisos de objeto por objeto profileObjPerms = [SELECT Id FROM ObjectPermissions where Parent.Id = :permSetId and SobjectType = :objName]; System. debug('Permisos de objeto para objeto:'+nombreObj+':'+permisosObj.tamaño()); try{ // Anular comentario de la línea inferior antes de ejecutar // delete perfilPermisosObj; } catch(Exception e){ System.debug('La actualización de permisos de objetos falló debido al siguiente motivo: '+ e + ',' + e.getStackTraceString()); } } // 3. Consulta para garantizar que se hayan eliminado todos los permisos de objeto relevantes ObjectPermissions[] objPerms = [SELECT Id FROM ObjectPermissions where Parent.Id = :permSetId and SobjectType = :customLCOAndDependentObjects]; System.debug('Volver a ejecutar los registros permanentes de objetos para CPQ y AA: '+ objPerms.size());
NOTA: Si la regla de precios no se define como el objeto maestro para SBQQ__LookupQuery__c, puede eliminar 'SBQQ__LookupQuery__c' de la lista de objetos en el paso 2 del código anterior.
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.