Best Practice: Multiple Chatter Posts of the Same File

Salesforce Administrators learn to remind users: “Search before you create a new lead.” Pretty simple, right? Duplicated records are a pain.
Then why do I see some very accomplished Salesforce users in the Dreamforce app posting duplicate Content/Files in Chatter?
Here are some examples from the Files tab:

I did it too - uploaded the same file three times instead of linking.

I've learned my lesson in the past 8 months... I promise!

Seven users uploaded the same file to Content

The better thing to do – assuming that you need to post the same file multiple times (this should be rare, as it might be considered Chatter Spamming, but when referring multiple users or groups to a document, it can come in handy) is to upload the file ONCE and use references to it in subsequent feed posts.
This has a bonus: Better maintenance! Instead of other users not knowing which file to follow if they want to be notified anytime that file is updated, just ensure that there is only ONE copy in the org, and everyone can follow that. This is especially useful for legal documents, employee handbooks, FAQs, Dreamforce App Codes of Conduct… you get the idea.

Not sure how it’s done? Here are a few screenshots:

Chatter File attachment screen with choice to link to existing content or to upload new content

Note the selected choice!


List of files I can attach.  Leftmost column is word "attach" to choose the file.

Clicking on "attach" closes the window


The file is selected, and there is a link to change to a different file if I choose.

Only one file can be attached


And there you have it! Go forth and attach! … and after that, just link.

 

Developer Preview Releases for the Google Visualization API

Dreamforce 2008 brought many exciting new features from salesforce.com, both on the CRM/front-end side and the Force.com platform/back-end side. One of the favorites was the announcement that salesforce.com had released a Google Visualization code share project. Google has invited developers to participate in Developer Preview Releases for the Visualization API.

It looks like a pretty cool way to work on RESTful integrations while making some pretty pictures for your users.

For those unfamiliar with the Salesforce/Google Visualization toolkit, developer.force.com has a great introduction.

 

Project: Lookup to Picklist

November 11, 2008 by David Schach · Leave a Comment
Filed under: Apex, Visualforce 

In the first installment of post-Dreamforce projects, I present a mechanism to present the user with all available Lookup options in a picklist. This should simplify some Visualforce pages. (Credit to the Developers Guide from the new post-Dreamforce Library.)

The key to the code is the ability to customize the SOQL statement to focus as much, or as little, as the developer would like. Though the code I provide makes no limit on the number of records returned, I encourage developers to limit the select statement as seen fit.

VF Page:

<apex:page standardcontroller="Child__c" Extensions="ChildExtension">
<apex:messages />
<apex:form >
<apex:pageBlock mode="edit" id="thePageBlock">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageblockSection id="ParentList" title="1">
<apex:pageBlockSectionItem >
<apex:outputLabel value="Parent" for="p"/>
<apex:selectList id="p" value="{!Child__c.Parent__c}" size="1" title="3">
    <apex:selectOptions value="{!ParentOptions}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>

Extension:
Note the SOQL query in Line 12 (below) that defines which records are included in the picklist. You can include WHERE and LIMIT statements to get the picklist down to a manageable number of items.

public class ChildExtension {

    private final Child__c child;

    public ChildExtension(ApexPages.StandardController controller) {
        this.child = (Child__c)controller.getRecord();
        }
    
    public List<selectOption> ParentOptions {get 
        {
        List<selectOption> parents = new List<selectOption>();
        for (Parent__c prt : [select name from Parent__c pt])
            parents.add(new selectOption(prt.id, prt.name));
            return parents;
        }
    private set;
    }
}

Because the parents List in the extension sends an ID to the application, it can successfully create a record with the parent Name in the picklist, but the ID in the background. You can also substitute a different field for Name: If you prefer, put a contact's email address or anything else. Try it out!

One more thing: This is an easy segue into another project, which will be a way to use the traditional lookup interface but to pre-filter the records available in the lookup.

And because I put this in every post: There's a catch. (There always is.) I'm sure that somewhere in there, Salesforce would prefer that we not create a picklist of a few hundred items. So please feel free to test the limits of this visualforce method, but please be prepared to filter your SOQL query.

On a separate note, I just had lunch with John Rotenstein aka The Enforcer, who already put up a photo of our time in his office. (I think the pirate logo was an accident, but it does add to my sinister persona, no?)

 

X-Squared at Dreamforce 2008

October 28, 2008 by David Schach · Leave a Comment
Filed under: salesforce.com, X-Squared On Demand 

Please be sure to register for sessions at Dreamforce.

And DEFINITELY don’t miss my session!

Wrangle Data & Pump up the Configuration
“I’m administering Salesforce. I’ve learned the ropes. Now I want to get great!” In this session, we’ll review the latest insights and subtlties that top Salesforce consultants have learned on the front lines. We’ll focus on data and configuration to help cut the time you spend massaging data. You’ll also learn how to implement tricky config quirks you never thought possible.
Speaker: Ezra Kenigsberg, SALESFORCE.COM
Speaker: David Schach, X-Squared On Demand LLC
Date: Monday, November 3
Time: 11:45 a.m. – 12:45 p.m.

I’m on the Administrator track – we’ll be providing tips for configuring your org implementation and optimizations, and for ensuring that things remain smooth as you move forward as a Super Administrator.

 

Next Page »

  • Recent Posts

  • Subscribe

  • Post Categories