Conga Print Queue using Skuid

  • 4
  • Praise
  • Updated 4 years ago
  • (Edited)
This is an idea that worked really well for me and may help you or spark an idea for you.  My issue was creating custom merge documents that could be manually batched together based on date range or other criteria.  I am using Conga and it merges very well but there was not a great out of the box way to do custom batches based on date ranges or other criteria.  For an organization this flexibility takes a very good solution and makes it perfect.  Skuid made perfection possible.

In my case we have daily medical appointments for our clients (using events), (clients are accounts), and their doctors (contacts), with all their prescriptions (custom object).  Conga did a very good job assimilating all that data.  But my team was requesting the ability to print the forms off for a week to 10 days at a time.  Conga did well here too.  But then I was getting requests for date ranges, which makes a lot of sense.  So I reworked the conga solution using Skuid and this is what I got.  (FYI - When I say "print" I mean "merge").



The top table in the page only shows "Events" that have been marked "To Print".  

The bottom table shows all Events. And it has the check box that they can mark "To Print".  Using Skuid they can filter the list by date or other criteria and then using the mass update option mark the "To Print" box as TRUE.  When they hit save, (I am using Skuid's Action Framework to lock the view, save the changes, re-query the models, and then unlock the view) anything that was marked "To Print" moves out of that table and into the "print queue".  And since my Conga button is set to print using the same criteria as my filtered table view, anything in the list actually prints.  

One other cool twist is Conga can update a field when it merges the document.  So I am having Conga add a Last Printed date to the "event" and unchecking the "To Print" field so that it is resets and can be printed again later if needed.  

By default the bottom section does not show any event that already has a Last Printed date.  But to reprint, simply click the "Reprint Forms" Skuid filter and all those events that have previously been printed show back up.  You can then select the ones you want, or select all or use the search filter to narrow it down even more.

So with Skuid, I am able to take the incredibly powerful Salesforce, the powerful third party Conga, and make a magnificent, user friendly solution, with the ALL POWERFUL Skuid.  In some ways it is like the ring that binds them all together and makes it super powerful. . . Except it is super good instead of evil :). (December 17, coming soon)

Without Skuid the solutions are almost perfect but with a series of setbacks and frustrations.  Skuid makes perfection solutions possible.  I Love it!  Takes the good and makes it better.
Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb
  • Estatic

Posted 4 years ago

  • 4
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
I really like what you've done here. I use Conga as well and can't wait to see what I'll do once I finish building the objects in salesforce and UI in Skuid.

I agree completely. Skuid makes solutions ZING!
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,984 Points 20k badge 2x thumb
That is super cool, Rich. Out of curiosity, what method are you using to tell Conga about what records you have selected in your Skuid table?
Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb
Hey Zach, I am no programmer so It is nothing more than simple logic. Using Conga Queries I use the following query. Basically, show all event where the client "area" is the same as in the url, the category on the event is "Medical Appointment", and the check box "Print Med Form is checked. Order them by StartDateTime and Conga has a 50 document limit.


Conga Query SOQL Select Statement

SELECT Id FROM Event WHERE Account.Area__c = '{pv0}' AND Category__c LIKE '%Medical Appointment%' AND Print_Med_Form__c = TRUE ORDER BY StartDateTime ASC LIMIT 50


In Skuid, I set up the same logic on the top model/table that I refer to as the print queue. The secret to telling Conga which events to use is the custom field "Print Med Form" checkbox, it really communicates the merge. So I make all fields in the rows read only except for the "Print Med Form" checkbox and the end user can quickly select the ones they need. The awesome part is the Skuid filters make it incredibly fast to select the items that should be merged and the mass update quickly moves those items to the "Merge Queue" table above. Since the Conga Merge automatically date and time stamps the event and unchecks the Print Med Form checkbox it makes everything recyclable. Meaning that the items in the Merge Queue now drop back to the selection queue table after the merge since Conga deselects them as part of the merge process. And by default once the event has been date and time stamped it disappears from the bottom queue too since the bottom model has a default on filter if the timestamp field is null. So everytime you look at the default page view initially you are only seeing future items that have not been merged. You can check the filter off that shows items that have been datetime stamped and then use the date range to narrow it down to remerge items if you need to. It really is just a simple print queue that can do pretty advanced things because of what we can do with filters and lists and mass updates in Skuid.
(Edited)
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,984 Points 20k badge 2x thumb
Thanks Rich, you answered my question with the bit about the "Print_Med_Form__c" checkbox --- a much simpler approach than the one I was thinking about. I was thinking you were somehow grabbing all the Ids of the selected rows and passing them to Conga via your button --- but your way is much simpler :)
Photo of Louis Skelton

Louis Skelton

  • 4,786 Points 4k badge 2x thumb
For those who scurried down this rabbit hole, I made a stab at making a mass action on a table that pulls selected records into a mass mail-merge using Conga Conductor. It's an In-Line Snippet. Seems to be working for me anyway! I'm not sure if it's posted anywhere else so I thought I'd post it here.

The two bits in bold are all you should need to change.

var params = arguments[0],
	$ = skuid.$;
	
	
// Get the Ids of the selected items as an Array


var idsArray = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){ 


   return item.row.Id; 


});


// Convert this array to a comma-separated String


var idsString = idsArray.join(',');


// Encode the string


var encodedIdsString = encodeURIComponent(idsString);


// STEP 1: CHANGE THE NEXT LINE TO THE TYPE OF RECORDS YOU'RE ACCESSING ON THE VIEW
// var idArray = {!GETRECORDIDS( $ObjectType.Lead )};

// STEP 2: CHANGE THE NEXT LINE TO THE API NAME OF THE FIELD THAT CONTAINS THE POINTMERGE URL


var urlFieldName="Conga_Batch_Profit__c";


// DO NOT MODIFY ANYTHING BELOW THIS POINT ********************

// YOU MAY PASS UP TO 50 IDS

var CongaURL = "https://conductor.appextremes.com/apps/Conga/Conductor/LaunchCC.aspx" +
"?MOID=" + encodedIdsString +
"&SessionId=" + skuid.utils.userInfo.sessionId +
"&ServerUrl=" + sforce.connection.partnerServerUrl +
"&UrlFieldName=" + urlFieldName;

window.open( CongaURL, "Conga", "width=700,height=450,menubar=0" );
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Cool!  Thanks Louis! 
Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb
Louis, thank you very much for posting this code.  I have been wondering how to use the default selection boxes to do this.  I just implemented this option and it works great.  Thank you for the code.
Photo of Louis Skelton

Louis Skelton

  • 4,786 Points 4k badge 2x thumb
I'm glad it worked out! It was mostly plagiarised from similar code Zach wrote for a different service... I believe you're only allowed to merge 50 records at once using Conga Conductor. If so, after producing the idsArray you can place the rest of the code in an if statement that produces a Skuid error message if the array has more than 50 values:

if(idsArray.length > 50) {
    var pageTitle = $('#LeadListTitle');
    var editor = pageTitle.data('object').editor;
    editor.handleMessages([{message: 'Oops-a-daisy! Up To 50 Profit Projections May Be Mailmerged At The Same Time. You Have Selected ' + idsArray.length + ' letters.',severity: 'ERROR'}])
} else {
// add the rest of the code

Just remember to give the title component on the page an Id and change the message :)