Development

Balance Progress between CRM UI and CRM Code Development

During CRM consulting projects there is always the need to show progress to customers. The caveat is that progress has to be shown with a certain amount of balance.

Too Much UI

You cannot do all of the UI development up front and show the customer. The problem with this is that to a non developer the UI in the CRM is everything. Once a customer sees the UI they assume that it works and all backend work is complete.

Too Much Code

Too much code is the complete opposite of too much UI. In this situation you will have almost all of the backend CRM functionality working but the customer will feel like you aren’t making any progress. This can lead to the customer not trusting the hours being put in during the project.

The Balance

Based on the type of CRM work being implemented it is important to find the right balance. Finding the right balance creates trust with the customer and ensures that your project goes smoothly.

Custom Logo: 99Designs or A Graphic Designer

When you are not a graphic designer, coming up with a logo or logo ideas for a product can be a grueling process. First you start off sketching out ideas on paper which depending on your skills may or may not come close to what you need. If it does then you still need to hire a designer to transfer it to a digital format which will cost an hourly rate.

I have been through the scenario of needing a logo a few times now. Up until this latest time I had always used a graphic designer and paid either an hourly rate or went with their “logo package” of a few logo ideas and a few revisions based on a set fee. In the end this usually ended up costing me more than anticipated for multiple reasons such as:

  • I wasn’t 100% sure what I was looking for in a logo.
  • The designer didn’t seem to understand what I was looking for
  • I just didn’t like the 3-5 ideas that were presented.

Most of these are pretty common reasons for spending more than anticipated for a logo. There are also multiple ways to get around these issues such as:

  • Have a very good idea of what you want before hiring a designer.
  • Pick a designer that spends time understanding before  starting.
  • Provide the designer logos and design themes that you have seen elsewhere that you like.

The fact is that once you have found a designer that you work well with, understands what is appealing to you, and has rates you can live with you will no longer have these issues. But until then, there is 99Designs.com.

99Designs.com is a crowd sourcing site that allows you to request a graphical design of almost anything and have hundreds of people submit ideas.  This is extremely helpful when you are not sure what you are looking for and only have a color scheme or vague idea. It also saves you the time involved with trying to come up with multiple ideas yourself when you may not be graphically enabled.

Here is how it works:

  1. Choose what you want designed ( Ex: Logo, Brochure, Site Mockup, etc )
  2. Set the price that you will pay to the winner.
  3. Set your criteria such as colors, size, fonts, and ideas.
  4. Launch the contest

What will happen is that designers will find your contest and start submitting ideas for you to comment and vote on. I recommend staying very involved in this process through the duration of the contest. When commenting and voting you can tell them what you do and don’t like and many designers will tweak their ideas based off of that information.

End the end you could potentially have hundreds of submissions to pick from which means that instead of having to settle on a logo or design you now have multiple quality designs and have to narrow it down to the winner.

Now that you know about 99Designs I have a few recommendations for when you try it out for the first time.

  • The amount you give to the winner is not the total cost. As one would guess, 99Designs.com has to get paid also. On my $175 logo 99Deisgns.com charged a fee of $56 for a total of $231. So be aware of this before you start filling out the design brief.
  • Get the logo on both a white background and another color background. Most effects on logos can look really good on white backgrounds but when moved to a different color loose their effect or meaning. This will help you visualize what your logo could look like on other mediums.
  • Use the tools that 99Designs provides to thank designers for submissions and to provide immediate feedback after posting.
  • Once you have a few submissions that you really like and will potentially pick, click the Guarantee button. By clicking this button you guarantee a payout which usually doubles the number of submissions.

At the end of my first use of 99Designs I was out $231 but I had over 175 submissions with about 10 logos that made it a very tough decision to choose. I also had about 50 more on top of that which were professional grade and could have done the job.

Tags: , , ,

SugarCRM: Where Are Global Email Settings Stored?

While working on the GetSocial Twitter Pro module I had to add settings in the admin area that were stored in the database. The problem was that I didn’t know where the settings were getting stored. The module that I was modeling my section after in the first iteration was the EmailMan module which stored most of its data in the emailman table.

I new that the global email settings were not stored in the emailman table based on the data that I entered and what I viewed in the table at the time. I also knew that I could have started debugging but it would have taken a while to comb through all the lines of code or to even pick a good breakpoint. Instead, again, WapSnap came to my rescue. I did a snapshot, changed the email settings, did a snapshot and then compared.

This immediately showed that the only thing that changed in my SugarCRM instance was the config table in the database. I opened up phpMyAdmin, looked at the config table and found where many of the global settings were stored.

Tags: , ,

Monday, March 30th, 2009 Development, SugarCRM, WapSnap Comments

SugarCRM: Adding Custom Settings to the Admin Area

Recently my GetSocial Twitter and GetSocial Twitter4Contacts modules started gaining traction on Blogs and in the Twitterverse. The more people that downloaded them the more requests I received for features and updates.

One feature that I knew was needed was the ability to configure the company account credentials in the Administration area of SugarCRM. This is where the research began.

I have made plenty of custom modules that when clicked show the list view and allow the addition of records. I have also customized these modules. However, adding areas to the Admin section that when clicked shows one screen with two fields that saves custom configuration variables was very different.

To see the functionality I am speaking of you can simply go to Admin -> License Settings or view the screenshot below.

license-view

I first started to create this area by trying to duplicate the functionality in the Email Settings. Email Settings actually uses the EmailMan module which has a standard module structure that manages the email Queue and a config section which holds the email settings. This means that when you click Admin -> Email Settings you go to EmailMan with the Config action ( index.php?module=EmailMan&action=config ). When you click Admin->Manage Email Queue you get the index action ( index.php?module=EmailMan&action=index ) and the Queue view

I duplicated this functionality to discover that it really wasn’t what I was looking for. I only wanted the functionality that was shown when the config action was called. Searching for a way to not create a full module that I didn’t need along with a config section I found the Licence Settings.

The license settings area works a little differently, it calls the Administration module and the LicenseSettings action ( index.php?module=Administration&action=LicenseSettings ). This functionality is driven by two essential files LicenseSettings.php and LicenseSettings.html under Modules/Administration. The fields that are filled out in this area get populated in the config table in the database.

The first step was to copy those files and to use them as a template to create the functionality that I needed. Once copied, I renamed them to the same name that would be called with the action which was TweetCreds. After changing the names I stripped out all of the LicenseSettings fields and added my two fields for filling in Twitter credentials.

The real issue came when I wanted to save my new fields. At first the field names where TWEETACCOUNT and TWEETPASSWORD and no matter what I did my fields would not get saved. More debugging and digging lead me to the Save.php file in the Administration module. In this file there is a foreach loop that loops through all of the POST parameters.

[code]

foreach ($_POST as $key => $val) {
$prefix = $focus->get_config_prefix($key);
if (in_array($prefix[0], $focus->config_categories)) {
if ( $prefix[0] == "license" )
{
if ( $prefix[1] == "expire_date" )
{
global $timedate;
$val = $timedate->swap_formats( $val, $timedate->get_date_format(), $timedate->dbDayFormat );
}
else
if ( $prefix[1] == "key" )
{
$val = trim($val); // bug 16860 tyoung - trim whitespace from the start and end of the licence key value
}
}

$focus->saveSetting($prefix[0], $prefix[1], $val);
}
}

[/code]

I could see that my parameters were making it this far but the loop wasn’t inserting them into the config table as expected. This leads me to the main takeaway item from this blog entry. You can’t just add fields with any name to be saved by this function. They have to follow a specific structure.

The structure that they have to follow is <Category>_<Name> . The category and name is what will get stored in the config tables first two columns ( Category, Name ). The third column ( Value ) hold the value of the variable. Once I figured this out and changed the fields to read TWEETCREDS_ACCOUNT and TWEETCREDS_PASSWORD. This still won’t work until you add the category name ( TWEETCREDS ) to the $config_categories array in Administrator.php.  This is also used by the foreach loop to do matching and to sure that the POST is not a throwaway value or a value used for some other action.

So as you can see, the naming scheme is very important when adding custom values to the config table and custom sections to the admin area.

I hope that this was a helpful post that will act as a partial guide that will assist you in adding your own custom admin sections with ease. Feel from to post and questions that you may have and I will try to provide an answer.

Tags: , , , ,

Friday, March 27th, 2009 Development, SugarCRM Comments

An Introduction to WapSnap

I have been actively Tweeting about WapSnap and speaking to various individuals about what it does. Today I determined that it was time for a proper introduction.

WapSnap meet world, world meet WapSnap.

Many of the intricacies about  WapSnap‘s product positioning are still in limbo. For now all that I can say is that it is a web based snaphsot and comparison utility that will compare both files, and databases to detect changes. Most peoples first response has been,  “doesn’t Git and SVN do that already?” My answer is, yes but only for the files.

The file comparison will be similar to a WinMerge and other comparison utilities like those built into Git. Where I would really like to differentiate is in the database comparison and manipulation area.   WapSnap will be able to compare databases all the way down to the field level in order to detect changes in applications. This leads to why I started building WapSnap.

Although others and myself attempt to use best practices when developing applications, sometimes developers end up working on the production box instead of doing an update from their favorite repository. This increases the risk of error and possibility of breaking production applications. The first response to this is to restore backups and risk losing data entered since the last backup. The alternative to backups is to track down the issue and try to fix it as quickly as possible. If you try to fix it the question will become, what all was changed? This is where WapSnap comes in. If you snapshot both the files and database before the changes are implemented then you narrow the search area to check for errors.

This becomes even more helpful for those using open source applications like Joomla and SugarCRM. Through many discussions I have found that users of open source applications commonly work on production instances because it is easier, cheaper, faster, and the applications take plugins or modules that most think work out of the box and won’t break their system. Yet another example of WapSnap‘s handiness is when someone installs a module, it breaks their app, then they uninstall and the app is still broken. WapSnap will easily let you detect the crumbs left behind in the file system and database so that they can be removed in less time that of what is needed to do a large restoration from backup.

Another huge benefit is that you learn more about the application. Take SugarCRM for instance, does anyone really know everything that happens behind the the scene we you use the Module Builder to build and deploy a custom module? Most people on the SugarCRM forums don’t and neither do I, most just speculate and build on past knowledge to guess what it is doing. The same goes for deploying 3rd party modules in any application.

Last but not least, where in the world does WapSnap comes from. I needed a name for a project that I was working on that took snapshots of web applications so I decided on W-Web, AP-Application, SNAP – Snapshot. Nothing special but it is staying until I come up with something better or decide to stick with it.

If you know of other tools that are helpful that have similar functionality please comment and let me know.

Tags: , , ,

WordPress Lost My Post and then I Got it Back

About a week about I wrote a small post ( SugarCRM Atlanta Meetup – Tips, Tricks and Tools ) as a follow up to a local Meetup that I attend and assist in organizing. After writing it I had to run out the door so I saved publishing until I could double check for spelling and other errors.  Once I returned, I published the post and didn’t log back in for a few days.

A few days had past and logging in showed that there were a few plugin updates and one Worpress update. Using one of my favorite features “automatic upgrade” I made a few clicks and the job was complete. Shortly after I checked to see how Google was doing with parsing my latest sitemap I realized that there was 1 404 error where a page could not be found. It was my latest post. I proceeded back to my blog admin section and it was completely gone. I am still not sure if it was the WordPress upgrade, a plugin upgrade or bug, or just user error.

The next step was to get it back. No matter how small the post, nobody likes to spend time disseminating information to have it disappear.

Step 1 to getting it back was to see if it still existed. I  logged into the database and searched through the posts table until I found the post. Luckily it was still there.

For step two I logged the id of the latest revision of that post and then opened the edit view on an existing post. After that I substituted my ID in the URL. This didn’t give me the edit view as expected but a revision view showing the latest revision and all past revisions. Since I didn’t see a way to post that revision or save it in some way I simply created a new post on another tab and did a copy and paste.

Now my post is available for the world to see. Hopefully you don’ t ever loose a post, but if you do, here is how to get it back.

Tags: , ,

Thursday, March 5th, 2009 Development Comments

First Steps with CodeIgniter and JQuery

When it came time to start adding some required AJAX functionality to WapSnap, I knew that hunting down and learning an AJAX/Javascript framework was going to be one of my most daunting tasks. I had played with YUI in the past with little success, likely due to my limited Javascript experience. After speaking with a few friends that are javascript experts I decided to start with JQuery.

To start with all I needed was callback functionality. Since the only tutorial on the JQuery tutorials page with callback in the title was AJAX Callbacks with JQuery, naturally that is where I started. In this tutorial there is a get method that looks like this:

  1. $.get(“giveMeSomething.php”, { number1: number1, number2: number2 },
  2. function(data){
  3. alert(“Data Loaded: “ + data);

The problem with the way this is written is that like the page the tutorial is hosted on, it generates ugly URLs.

WapSnap is built on the CodeIgniter framework which in the default installation means that you do not use hideously formatted parameters in the URL such as ?id=1&type=2. In CI ( CodeIgniter ) the example just given could look like /1/2 or /id/1/type/2. This structure which I find more enjoyble and visually appealing became my first problem with the mentioned article.

The code snippet shown automatically adds a question mark after the GET url and then formats and appends the data in the second parameter. This instantly caused a problem which lead me to a good bit of searching. After Google didn’t return enough entry level help for my searches I turned to the JQuery IRC channel which resulted in a solution.

For anyone else that may be looking for a solution to searches like “remove ? from get request in JQuery” or “remove question mark from get request in JQuery” The solution for me was to append the variable in the first parameter and leave out the second parameter. Which resulted in the following:

var db_id = $(‘#db_server’).attr(‘value’);

$.get(“ajax/getdatabases/” + db_id, function(data)
{

Now that the URL was being requested correctly I needed to parse the data returned. More searching lead to a funkatron article: Safely Parsing JSON In Javascript. For those of you who don’t know Funkatron, he is a well know PHP speaker, creator of Spaz the open source Twitter client, and a hilarious and helpful guy. He actually gave me my first CodeIgniter lesson on the floor at PHP | Works 08. With this article I was able to quickly and easily parse the JSON data sent back from my PHP page, something that wasn’t so easy when I first tried YUI a few months ago.

While I was debugging with Firebug I noticed that as a Javascript noob the errors weren’t as helpful as they could have been so I searched for a Javascript syntax checker. I immediately found JSLint which gave a little more in depth errors.

Tags: , , , ,

Wednesday, March 4th, 2009 Development, WapSnap Comments

SugarCRM: New User Tips

SugarCRM is, for the most part, a channel sales organization. What this means for new users is that depending on the company/channel that the SugarCRM licenses are bought through, the new customer may or may not be given “the necessities” after the purchase. “The necessities” in this case are the links to information required to answer product questions after the sale takes place. In many instances new customers are given a license key and information about professional services and consulting.

In the next few paragraphs I will point you to the additional documents that you will need to have on hand in order to answer product questions as you move forward with your new CRM.

Documentation

The first area that we will look at is the SugarCRM Documentation page. Once you browse to this page you can pick the SugarCRM Edition that you are using and then the tab with your version. Under this tab there will be two or three guides depending on your version.

The first is the User Guide which will tell you about using every area of the product except the admin section. The documentation is very well written and answers almost any question that you may have.

The second document is the Installation and Administration Guide. This document will tell you everything that you need to know about the administration of SugarCRM. The installation portion will tell you how to install SugarCRM but will not tell you how to setup the webserver which is required to run the software. This is left out mainly because there are just to many different configurations and types of webservers on the market for SugarCRM to effectively provide this data. Also, if you are not familiar with or do not have someone that knows webservers in your organization then you should purchase the SaaS service and let someone else host SugarCRM.

The last guide is the developers guide. Currently this can be found in the forum or under the SugarCRM 5.1 version tab. It provides information about how SugarCRM operates internally so that you can make upgrade safe customizations and more easily adapt SugarCRM to your organization.

SugarCRM University

SugarCRM offers a healthy amount of documentation on the product. In conjunction with the documentation they also offer training, 80% of which is free. When you browse to the SugarUniversity page you will be presented with the SugarCRM Online Library and the Learning Sessions. The library holds step by step tutorials in written format and the learning sessions are videos that tell you how to use various areas of the product. I suggest that most users head over to the learning sessions and spend some time getting to know the product before they login.

The Forum

After you have searched the documentation and watched the videos you may still have questions. If you browse over to the SugarCRM Forum you will see a very active Help section. In this section you can post any general help related questions that you may have. Another good tip is to post to the forum before you open a support ticket. Most of the time someone else will be on the forum at the same time you are and can provide a quick answer or follow up.

Support vs Code Support

SugarCRM Support is the place that you go once you have exhausted all of the options above. One thing that SugarCRM support will not help you with is code level changes. Most of the time if it is in the form of a question such as “where should I put this file for it to be upgrade safe” then they will help. But sending code snippets asking for them to tell you why something won’t work is not part of the contract. Coding is one of those things were there is just to many variables. So, stick to sending in support tickets on product questions that you can ‘t figure out or if something breaks. For the developers, SugarCRM offers the forum and the Developer Zone.

Developer Zone

The Developer Zone is exactly what the title says. It is an area of the SugarCRM site that provides information around developing in SugarCRM. The blog is frequently updated by engineers and other SugarCRM team members which provides you up to date information about addons to various areas of the product. The tools and tutorials sections allow anyone to provide documents written about SugarCRM which range from “Light boxing in a detail view” to “Programmatically Hiding and Displaying Panels Based on the Value of A Drop Down in 5.1.”

SugarForge vs SugarExchange

The questions about SugarForge and SugarExchange come up for almost every new SugarCRM user. The forge and exchange are places to download modules that will add to the functionality of SugarCRM. They are very easy to install and instructions can be found in the Installation and Administration Guide.

  • SugarForge

SugarForge is where developers can post modules that they want to share with everyone at no cost. These are use at your own risk modules that you will want to try out on a test machine before deploying to production.

  • SugarExchange

This area is where users can buy and sell modules. One things to keep and eye out for in this section is the Certified by SugarCRM logo. This means that when you purchase a module, if it causes a problem with your SugarCRM instance that the SugarCRM support group will assist you. This points out another tip. SugarCRM support will not help you with 3rd party modules. You will need to contact the module builder to get support.

I hope that this has lead you to SugarCRM resources that you were not aware of and that will help you get moving in the right direction. If you have any other resources that were helpful to you during the time you were learning about SugarCRM please comment or email them to me.

Tags: , , , , ,

Wednesday, December 24th, 2008 Development, SugarCRM Comments

First Days with CodeIgniter and MVC

I have begun the research and studying that will be required to rewrite SecurityDistro.com. This research has lead me to believe that the most efficient way to start would be with a PHP framework.

I started by looking through a few common frameworks, their install process, and their documentation. The search began with Zend, CodeIgniter, and Symfony. I installed each one and started looking into what it would take for someone like myself to learn MVC using these frameworks. My requirements were that it needed to be an easy introduction to MVC and that it wouldn’t require me to start from scratch on SecurityDistro.com. I wanted to make incremental improvements to the site as I learned the framework.

At first glance Zend appeared to be a hodge podge of different libraries which would require me to do a good bit of work just to start playing with it. I could be wrong but this was my first impression.

Symfony was actually my first choice in frameworks but when I started going through the Propel ORM setup which appears to be required for Symfony I decided that I didn’t want to spend the next 2 weeks learning an ORM tool before I got started in the framework.

Last on the list was CodeIgniter. From the description it was lightweight and would require little setup to get going. The description of the framework was oddly accurate. I installed CodeIgniter in a subdirectory on my test box and was viewing the default index page in just a few minutes. CodeIgniter also offers two “getting started” style video tutorials that are fairly short and very helpful. After watching the videos and playing around a bit I started looking through the documentation. The documentation provided was straight forward and gave easy to understand instructions on how to use the various resources provided by the framework.

After watching the tutorials and browsing the documentation I started to write a little code. This quickly led me to more questions including how to get the index.php segment out of the middle of my URL. A little searching provided this tutorial which was exactly what I was looking for. The tutorial walked through the best way to rewrite the URL in order to have a nice clean URL.

My next issue was MVC structure. Since I have never worked on an MVC application I was in the dark about the structure and how things were supposed to be designed. I knew what the M, V, and C stood for and did but had no idea how the data flowed between them. Turning back to the CodeIgniter documentation I found a nice little diagram to get me started. This got me moving in the correct direction but after more coding I can already tell that MVC application structure will need to be added to my required reading list.

I have now started reading an older CodeIgniter book called CodeIgniter for Rapid PHP Application Development. So far it has been very informative even though it is somewhat out of date.

Tags: , ,

Wednesday, November 19th, 2008 Development Comments