You need to sign in to do that
Don't have an account?
Bob
Update custom quote field checkbox checked if on specific Opportunity record type
I have a trigger that should only update quotes if the opportunity record type is 'NA Opportunity Record Type' . I've tried to add it into the trigger but nothing has worked. Any help would be greatly appreciated.
trigger Trigger_MarkPrimaryQuote on Quote (before insert) { // List<String> oracleQuoteList = new List<String>(); for(Quote qRec : Trigger.new) { qRec.Primary_Quote__c = true; oracleQuoteList.add(qRec.Oracle_Quote__c); } // List<Quote> quoteListToUpdate = new List<Quote>(); for(Quote qRec : [SELECT id,Primary_Quote__c,Oracle_Quote__c,Opportunity.RecordType.Name from Quote WHERE Oracle_Quote__c IN : oracleQuoteList]) { qRec.Primary_Quote__c =false; qRec.Opportunity.RecordType.Name ='NA Opportunity Record Type'; quoteListToUpdate.add(qRec); } // if(quoteListToUpdate != null && quoteListToUpdate .size() > 0) { update quoteListToUpdate; } }
When you actually wants to update this quote button, every time when a new record of Quote object with Opportunity type = "NA Opportunity Record Type" or there will be some other conditions.
If you can let me know this then I'll able to help you.
Use above code to check Primary_Quote__c checkbox on Quote every time when a new Quote whose Opportunity type is 'NA Opportunity Record Type' get created.
Please let me know if you need more assist on this.