Showing how many followers a customer has on Twitter

sugarcrmdevelopers —  April 20, 2012

So you have some customers that have provided their Twitter username to you in SugarCRM, but you want to know a bit more information about them. Well, this is the first part of a series of tutorials/posts based around how to flex SugarCRM around social media.

First things first, add your new fields. These fields need to be as follows:

Module: Contacts
Data Type: TextField
Field Name: twittername
Display Label: Twitter Name:

Module: Contacts
Data Type: IFrame
Field Name: twitterfollowers
Display Label: Twitter Followers
Generate URL: Checked
Default Value: http://www.yourwebsitelocation.com?q={twittername_c}
Max Size: 255
IFrame Height: 100

Now check Dependent as we only want this new twitterfollowers field to appear if there is a value in twittername. Make the formula as follows:

not(equal($twittername_c,””))

We need to make sure we’re passing the Twitter ID as a parameter called ‘q’ to our HTML/JavaScript script. We’ve specified the location of where my HTML file will be uploaded to. This is outside of SugarCRM.

Next add it to the layout. I’ve added mine to the top panel.

and added it to both views:

Finally, upload the Twitter HTML/JS script to the location of your choice. Download it from here. A screenshot of what it looks like is here:

Now see the finished result:

Keep following for further SocialCRM enhancements in this series, showcasing how Sugar can work well with social.