Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<SBQQ__Quote__c> currentQuotes = [SELECT Id,
- SBQQ__QuoteTemplateId__c,
- RecordTypeId FROM SBQQ__Quote__c where
- (SBQQ__Status__c = 'In Draft'
- OR SBQQ__Status__c = 'Rejected')
- AND RecordTypeId != '012f3000000gzaXAAQ'
- AND RecordTypeId != '012f3000000gzaYAAQ'
- AND RecordTypeId != null
- AND SBQQ__QuoteTemplateID__c NOT IN ('a1Qf3000008BYiGEAW','a1Qf3000008BYiHEAW','a1Qf3000006R82AEAS')
- limit 50];
- String AutomotiveQuote = '012f3000000gzaXAAQ';
- String AutomotiveQuoteReadOnly = '012f3000000gzaYAAQ';
- String HEREPartnerQuote = '012f3000000YbcGAAS';
- String HerePartnerQuoteReadOnly = '012f3000000Ybg1AAC';
- String HerePartnerQuoteReadOnlyv2 = '012f3000000YbcHAAS';
- String PriceLetter = '012f3000000gzZFAAY';
- String PriceLetterReadOnly = '012f3000000gzZLAAY';
- String Quote = '012f3000000gzZGAAY';
- String QuoteReadOnly = '012f3000000gzZMAAY';
- String quoteTemplate = 'a1Qf3000008BYiGEAW';
- String partnerQuoteTemplate = 'a1Qf3000008BYiHEAW';
- String priceLetterTemplate = 'a1Qf3000006R82AEAS';
- for(SBQQ__Quote__c quoteTMP : currentQuotes){
- if((String)quoteTMP.RecordTypeId == HEREPartnerQuote
- || (String)quoteTMP.RecordTypeId == HerePartnerQuoteReadOnly
- || (String)quoteTMP.RecordTypeId == HerePartnerQuoteReadOnlyv2){
- quoteTMP.SBQQ__QuoteTemplateId__c = partnerQuoteTemplate;
- System.debug('To jest partner ->' + quoteTMP.SBQQ__QuoteTemplateId__c);
- }else if((String)quoteTMP.RecordTypeId == Quote ||
- (String)quoteTMP.RecordTypeId == QuoteReadOnly){
- quoteTMP.SBQQ__QuoteTemplateId__c = quoteTemplate;
- System.debug('To jest zwykly quote ->' + quoteTMP.SBQQ__QuoteTemplateId__c);
- }else if((String)quoteTMP.RecordTypeId == PriceLetter ||
- (String)quoteTMP.RecordTypeId == PriceLetterReadOnly){
- quoteTMP.SBQQ__QuoteTemplateId__c = priceLetterTemplate;
- System.debug('To jest price letter ->' + quoteTMP.SBQQ__QuoteTemplateId__c);
- }
- }
- update currentQuotes;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement