Skip to main content

Generating pdf Using Conga Composer

Conga Composer lets you to create documents from a button or link placed on a Salesforce.com page layout. It merges Salesforce.com data with Word, Excel, PowerPoint, email, or PDF templates to create finished documents.

Benefit Of Conga Composer

  • Easily create and deliver customized documents, 
  • Presentations and reports using Word, PowerPoint, Excel, HTML email and PDF forms from standard & custom objects. 
  • Generate quotes, proposals, account plans, invoices, contracts, letters & more.
In order to use Conga Composer, we need to install two things.
  •     Conga Composer 
  •     Conga Query Manager.

If we need to use some related object's record then Conga Query Manager is necessary otherwise Conga Composer is enough.

How to Install Conga Composer


Go through this link for installation .

http://knowledge.appextremes.com/appextremes/ext/kb110-how-to-install-conga-composer

How to Install Conga Query Manager


Go through this link for installation .

http://knowledge.appextremes.com/appextremes/ext/kb611-how-to-install-conga-query-manager

We already have some sample design in our local drive which signifies how the information will be presented , If we don't have then we will make one using word or anything else.

Now we will create  Conga Template and Conga Query.



Creating Conga Template

Click New button on Conga Template to create one template
After template creation ,click on AttachFile button to attach some sample template from your local drive.






Creating Conga Query

If we have to display some related object record then we have to create conga query to pull data from salesforce, here we can define as many query as want.
There is field called SOQL Select Statement where we have to write query.
For example query will be like this 

SELECT invoiceit_s__Accounting_Code__c, invoiceit_s__Charge_Date__c, invoiceit_s__Service_End_Date__c, invoiceit_s__Service_Start_Date__c, CreatedById   FROM invoiceit_s__Invoice_Lines__c WHERE invoiceit_s__Invoice__c = '{pv0}

Here we are querying data from invoice lines that means button must be in invoice page.

There are two different approach for generating document.

  • By Clicking a Button
  • Some Automation process by using Work flow  

By Clicking a Button
  • Create a custom button on master object 
  • Choose content source as URL
  • paste this code 

https://www.appextremes.com/apps/Conga/PointMerge.aspx?SessionId={!API.Session_ID}
   &ServerUrl={!API.Partner_Server_URL_80}
   &Id={!Credit_Note__c.Id} //object id where button is present
   &DefaultPDF=1
   &PartnerCode=0015000000Yd8nM // optionals 
  &EmailReplyToId{!User.Id}
  &EmailToId={!Credit_Note__c.Billing_ContactId__c}//to whom emil is going
  &EmailRelatedToId={!Credit_Note__c.Id}//object id where button is present
  &TemplateId=a0mb0000000KYO0 // conga templae id which you have created
  &QueryID=[CreditLines]a0nb0000000zgUE //conga query id, you can give many query id by using comma

How to use Conga Composer 

Go through this pdf 

Automation Process
  • Create one formula field and one checkbox field on mater object.
  • When that check box is true then workflow will be fired.
  • Create a email template through which email will be going to the customer.
  • In the formula field paste this code 

 "&Id="+Id 
   +"&TemplateId=a0pW000000335Xt" //conga template id
   +"&EmailTemplateId=00XW0000000M8Hp" //the emailtemplate id which you have created
   +"&QMode=3" 
   +"&DefaultPDF=1" 
   + "&EmailToId=" + invoiceit_s__Billing_Contact__c 
   +"&QueryID=a11W0000000ov1y,a11W0000000ov1t" //conga query id
   +"&EmailRelatedToId="+Id

  • Create work flow and an outbound message.
  • Give End point Url as https://workflow.appextremes.com/apps/Conga/PMWorkflow.aspx.
  • Select that formula field Account fields to send to selected fields.
  • Click on Save
Now work flow and outbound message is ready, when that checkbox will be ready a mail with attachment will reach to the contact's email.
For more information about salesforce conga work flow , please go through this pdf


Comments

Anonymous said…
Hi,

I implement the same as your the Endpoint URL is executed successfully but, I'm not able to receive the email.

End point :
1) https://workflow.appextremes.com/apps/Conga/PMWorkflow.aspx
2) https://workflow.congamerge.com/OBMListener.ashx

Parameters :
"&Id="+Id
+"&TemplateId=a0g4F000000cRcF"
+"&EmailTemplateId=00X4F000000MIJa"
+"&QMode=3"
+"&DefaultPDF=1"
+ "&EmailToId="+Email__c
+"&QueryID=a0Y4F00000431nS"
+"&EmailRelatedToId="+Id

Please assist me

Thanks
saivenkat said…
Everyone wants to get unique place in the IT industry’s for that you need to upgrade your skills, your blog helps me improvise my skill set to get good career, keep sharing your thoughts with us.
Best quoting software

Popular posts from this blog

How to Create a Tooltip in Lightning Datatable ?

Imagine you have a datatable displaying a list of Contact records , and one of the columns shows the Account Name . The Account Name is a hyperlink that allows users to navigate to the Account record page. But what if users want to take a quick glance at some key Account fields —like Phone or Address—without navigating to the Account record? In Salesforce Classic, this was achieved using the Mini Page Layout feature from standard page. However, in Lightning Experience, we can implement a similar feature by adding a tooltip to the data table. Solution Overview: We’ll create a Lightning Web Component (LWC) that: Displays a data table with a clickable Account Name . Provides a tooltip that shows the Account's Phone and Address fields when users hover over the Account Name. Implementation Steps: 1. Data Preparation We need to retrieve the following fields for each Contact and its associated Account: Contact Fields : Name, Phone, Email Account Fields : Name, Phone, Billing Addre...

How to Create/Delete file attachments(Content Document) through Apex ?

 There are 3 standard salesforce objects to store file attachments. Content Document, ContentDocumentVersion, ContentDocumentLink.  Here is the article to talk about these objects and relationship.  https://www.forcetalks.com/blog/contentdocument-and-contentversion-in-salesforce-an-overview/ ContentDocumentVersion ContentDocumentLink This post is all about how to create/delete content document though Apex. Here is code snippet // Insert Content Version record ContentVersion contentVersionRec = new ContentVersion(Title='filename',PathOnClient ='FileName.pdf',VersionData = bodyBlob,origin = 'H'); INSERT contentVersionRec; // this will insert one record in ContentDocument and ContentVersion , ContentDocument  is parent and  ContentVersion is child record // get contentdocument id contentVersionRec = [SELECT Id, Title, ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionRec .Id LIMIT 1]; // Create Content Document Link record- This will attach ...

Lifecycle hooks in LWC

There are 3 phase of LWC component  1. Mounting  A. constructor, B. connnectedCallback C. render D. renderedCallback 2. UnMounting  A. disconnectedcallback 3. Error  A.errorcallback Note - render is not lifecycle hook, it is protected method of Lightning element class. Mounting Phase LWC Creation and Render Life cycle Constructor Method ·        This method called when component is instantiated and It flows from parent to child component. ·        Need to call Super() inside constructor method ·        Can’t access any component properties or child component because it’s not ready yet. ·        Host element can be accessed through “this. template” inside constructor method. ·        Don’t add any attributes to host inside constructor C   constructor (){          super (); //...