-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
3Replies
Generate Quote Document with Apex Trigger
I have a requirement to automatically generate a quote document once a quote's status is set to "In Review." I'm able to succesfully create the quote document record, but the actual document itself is not being generated. I also tried scheduling the MassQuoteDocumentSender class and had the same result. Here is what I have so far:
trigger createQuotePDF on SBQQ__Quote__c (after update) {
List<SBQQ__QuoteDocument__c> sr = new List<SBQQ__QuoteDocument__c>();
for (SBQQ__Quote__c q: Trigger.new)
if (q.SBQQ__Status__c== 'In Review'){
sr.add (new SBQQ__QuoteDocument__c(
SBQQ__Quote__c = q.Id,
SBQQ__Template__c = 'Standard Quote'
));
}
insert sr;
}
Any help would be greatly appreciated!
trigger createQuotePDF on SBQQ__Quote__c (after update) {
List<SBQQ__QuoteDocument__c> sr = new List<SBQQ__QuoteDocument__c>();
for (SBQQ__Quote__c q: Trigger.new)
if (q.SBQQ__Status__c== 'In Review'){
sr.add (new SBQQ__QuoteDocument__c(
SBQQ__Quote__c = q.Id,
SBQQ__Template__c = 'Standard Quote'
));
}
insert sr;
}
Any help would be greatly appreciated!
-
- Nick D'Addario
- March 02, 2020
- Like
- 0
- Continue reading or reply
Generate Unique Non-Random String?
Hi All,
I'm looking to generate a unique string for each account. The string will be a concatenation of the first four letters of the account name and then a couple other characters depending on the natrure of the account. The trouble I'm having is with the unique part. If a generated code matches an existing code, then I'd use the next character in the account name. If there is no next character, use a 1. If there is already a match with the appended 1, use 2 and so on.
Also, for some context, the code would be generated when a new opportunity is created.
Anyone have an idea on how I'd accomplish this?
Thanks,
Nick
I'm looking to generate a unique string for each account. The string will be a concatenation of the first four letters of the account name and then a couple other characters depending on the natrure of the account. The trouble I'm having is with the unique part. If a generated code matches an existing code, then I'd use the next character in the account name. If there is no next character, use a 1. If there is already a match with the appended 1, use 2 and so on.
Also, for some context, the code would be generated when a new opportunity is created.
Anyone have an idea on how I'd accomplish this?
Thanks,
Nick
-
- Nick D'Addario
- April 01, 2019
- Like
- 0
- Continue reading or reply
Visualforce Page on Opportunity to Update Account Fields
Hi Guys,
I'm trying to build a Visualforce page on the opportunity record that allows users to update a few fields on the parent account. I have built the visualforce page, but can't get the newly input values to save back to the account. I'm fairly sure that Opportunity should be the standard controller and I'll need an extension. That's the part I'm having some trouble on.
Can someone point me in the right direction on how I'd accomplish this?
Thanks,
Nick
I'm trying to build a Visualforce page on the opportunity record that allows users to update a few fields on the parent account. I have built the visualforce page, but can't get the newly input values to save back to the account. I'm fairly sure that Opportunity should be the standard controller and I'll need an extension. That's the part I'm having some trouble on.
Can someone point me in the right direction on how I'd accomplish this?
Thanks,
Nick
-
- Nick D'Addario
- June 06, 2018
- Like
- 0
- Continue reading or reply
Adding Attachments from Notes & Attachments section to Visualforce Email Template?
I'm looking to add all of existing attachments from the Notes & Attachments section on opportunities to a Visualforce email template. The Email is sent automatically (Process Builder) when an opportunity reaches a certain stage. I'd imagine that I'd need to use an apex class that creates the email itself, calls the template I've made, and appends the attachments to it. I would then use process builder and define the apex class as the the action instead of the email template. Has anyone had any success in doing this?
-
- Nick D'Addario
- July 03, 2017
- Like
- 0
- Continue reading or reply
Visualforce Page on Opportunity to Update Account Fields
Hi Guys,
I'm trying to build a Visualforce page on the opportunity record that allows users to update a few fields on the parent account. I have built the visualforce page, but can't get the newly input values to save back to the account. I'm fairly sure that Opportunity should be the standard controller and I'll need an extension. That's the part I'm having some trouble on.
Can someone point me in the right direction on how I'd accomplish this?
Thanks,
Nick
I'm trying to build a Visualforce page on the opportunity record that allows users to update a few fields on the parent account. I have built the visualforce page, but can't get the newly input values to save back to the account. I'm fairly sure that Opportunity should be the standard controller and I'll need an extension. That's the part I'm having some trouble on.
Can someone point me in the right direction on how I'd accomplish this?
Thanks,
Nick
- Nick D'Addario
- June 06, 2018
- Like
- 0
- Continue reading or reply