Happy Thursday, everyone! I hope y’all are getting excited for Dreamforce - the whole Conga team has been furiously signing up for sessions with the Agenda Builder this morning. We have a veritable boatload of activities planned for this year’s event, lots more to come on that front in the near future.
Today, we dive into our first black diamond Tips & Tricks post! With great power comes great responsibility, so let’s make like Peter Parker and get nerdy.
In today’s post, I’ll be showing you how to set up an auto-incrementing version number for documents generated by Conga Composer. This is especially useful for documents like quotes or contracts where it’s common to whip up a few iterations before it’s approved or finalized. This technique is record-specific in Salesforce, so if you’re working from the same Opportunity record and generating multiple versions of the same quote over time, Conga Composer uses some simple formulas and field updates to keep track of each version for a taste of automated glory.
This trick requires a good understanding of the Master Field to Set (MFTS) feature, which allows you to update the value of a field upon merging. It’s pretty darn useful for a lot of things, but I’m going to walk you through how it’s used for version numbering:
Step 1: Create two new custom fields on your preferred object
Field #1
Data Type: Number
Name: Version #
Length: 3 digits
Decimal Places: 0
Default Value: 1
Note: The default value will apply to any new records, but this field will need to be assigned a value of 1 for any existing records.
Field #2
Data Type: Formula - Number
Name: Next Version #
Decimal Places: 0
Formula Syntax: Version__c + 1
Note: This field does not need to be added to the page layout if you're using Enterprise Edition or above, but Professional Edition users will need to park it somewhere on the layout for the formula to evaluate.
Step 2: Add MFTS parameters to your Composer button
This is where the magic happens. There are 3 required button parameters to make this work:
&MFTS0 – References the API name of the field to update
&MFTSValue0 – Specifies the value to be pushed into the field referenced by MFTS0
&LG4 – Enables automatic activity logging, which is required for MFTS parameters to work
Those are the crucial ingredients, but here’s how these parameters are used in a button URL. I’m using the Opportunity for this example:
https://www.appextremes.com/apps/Conga/Composer.aspx
?sessionId={!API.Session_ID}
&serverUrl={!API.Partner_Server_URL_80}
&id={!Opportunity.Id}
&MFTS0=Version__c <-- Note: this is the API field name
&MFTSValue0={!Opportunity.Next_Version__c} <-- Note: this is the merge field, not the API field name
&LG4=2
There’s a lot going on in that button URL, so let’s break it down. The MFTS0 parameter is specifying the API name of your version number that will be auto-incremented when you merge and log activities. The value that’s plowed into that field is supplied by MFTSValue0, which is retrieving the merge field of the next version number. LG4 is required, but flexible. Setting a value of 1 will automatically log a task in Activity History and update your fields with MFTS, setting a value of 2 just updates your fields with MFTS with no completed task.
Step 3: Put it to Work!
Now that the mechanics are in place to increment version numbers as you merge documents, there are a few ways you can use this.
1) In your output file name
The OFN parameter allows you to specify a file name for your output, so what better place to put a version number? You can do this like so:
&OFN=Quote+Version+{!Opportunity.Version__c}
If this were the second iteration of a quote in Word format, the resulting file name would be “Quote Version 2.docx”
2) In your output file
Now that you’ve got a field that displays the current version number, you can add it to your template just like any other merge field. Stuff it in the footer of a contract, append the version number to the title of your proposal or add it to your quote as a watermark –tons of options here.
3) As the subject of a completed activity
If you’re creating a completed task as part of your activity logging process, putting the version number in the subject is a great way to keep track of multiple documents over time. You can do this with the LG1 parameter like so:
&LG1=Quote+Version+{!Opportunity.Version__c}+created+on+{!TODAY()}
If this were the second iteration of a quote, the completed activity would look like this:
There you have it, a method for creating auto-incrementing version numbers for your documents. Because version numbers can be used in a variety of ways, this technique is pretty flexible depending on your requirements. It also works great for Conductor and Workflow for batch and event-triggered merges.
Lastly, a big shout out goes to our very own @CongaPete for being inducted into the Salesforce MVP Program and becoming the co-leader of the Salesforce Denver User Group. We’re humbled by his presence! See you next week, and don’t forget to subscribe so you never miss a post.