Skip to main content
Conga Support

Attach File

Custom Action Name


Objects affected

Any objects that can have Attachments.


This custom action adds an Attachment from any object that can have them. Use this on the level of the object you wish to attach something to. This will open a new window for each selected record, where you can add a Salesforce attachment using the native Salesforce attachment mechanisms.

This will show up on the Action Menu for all objects that allow attachments.

Use Cases

This is currently the main method for adding an attachment to a group of records via the Conga Grid. This will open a new window/browser tab for each selected record, allowing a different attachment to be added to each selected record.


The use of JavaScript in Conga solutions is considered an advanced method, requiring JavaScript knowledge, and is not supported by Conga or the Conga support team. You are welcome to use this feature at your own risk.

Follow these steps to create the custom action:

  1. Click Conga Grid Setup.
  2. Select the object for which you want to create the custom action.
  3. Select the object Features tab.
  4. Click New Custom Action. The Custom Action screen appears.
  5. Delete the sample code from the Javascript field.
  6. Copy and paste the following code into the Javascript field.
  7. Copy the itemID value and paste it as the Action Name.
  8. Click OK.
crmc.require(["KendoEntry", "KendoPopup", "ListButton", "sfdc"],
function(prompt, popup, navigate, sfdc) {
        "itemID": "AG_AttachFile",
        "isAvailable": function (context) {
            var multipleSelected = context.selectedRows && context.selectedRows.length > 0 && context.selectedRows.length <= 5;
            if (multipleSelected && this.featureSecurity.getSetting(, this.itemID) !==false){
               var children = context.objectDescribe.childRelationships;
               for (var i = 0; i < children.length; i++) {
                 if (children[i].childSObject == 'Attachment'){
                       return true;
            return false;
         "getLabel": function (context) {
           return "Attach File";
         "createSubmenuItems": function (context) {
             return [];
         "click": function (context) {
             var ids = [];
             var data = sfdc.query("SELECT Id, Name FROM "" WHERE Id IN('" + ids.join("','") + "')");
             for (var i = 0; i < data.length; i++) {
                 var row = data[i];
               if(row.Name != undefined && row.Name != null){
         "/p/attach/NoteAttach?pid=" + row.Id+"&parentname="+encodeURIComponent(row.Name));
  • Was this article helpful?