Monday, April 30, 2012

SugarCRM Troubleshooting: Error Deploying Custom Module - Part II

Some months ago I wrote an article discussing a potential solution to an odd problem relating to the deployment of custom modules from within the Module Builder tool. While helpful, there are other situations which may also lead one to the same error.

Recently, the same error appeared on a system when one attempted to deploy a custom module, despite not having any other modules deployed. Attempting to Export the module also failed, with an error indicating that the zlib PHP extensions were not available on the system. This error was critical in resolving the matter at hand.

The zlib extensions are used to compress and decompress zip archive files, i.e. create and open zip archives. As noted in my previous article regarding this topic, the deploy process in Module Builder relies on module packages in order to complete its work. Said packages are zip files. If the system is unable to create the zip archive during the deploy process, as in this case, the deploy process will fail with the error message of:

"An error has occured during deploy process, you package may not have installed correctly."

In summary, if the advice in my prior article does not help resolve your problem, verify that the zlib extensions are installed, as this may also be the source of the problem.

Adding zlib to your PHP installation will vary by system and may require you to recompile. You should consult the PHP documentation for further information on adding/installing zlib support.

Thursday, April 19, 2012

SugarCRM Customization: Dynamic Subpanels

Suppose we are working on a SugarCRM instance for an organization that uses the Accounts module to store records representing either customers or suppliers. The distinction is made by selecting the appropriate value on the Account Type field of an Account record. 

Opportunities, or sales, are only relevant to customers, as suppliers would not be purchasing from the organization. Our task is to simplify the DetailView screen as much as possible by removing unnecessary components. 

Eliminating components from the view has the net effect of making it easier for users to quickly locate data they find most valuable, along with simplifying navigation. With this goal in mind, we conclude one helpful customization would be to only display the Opportunities subpanel on records that are of type Customer

How do we accomplish this?

It is actually rather simple. To apply this type of customization, we simply need to create a custom PHP file and execute a Quick Repair and Rebuild of our SugarCRM instance.

What does that custom PHP file look like?

Thursday, April 12, 2012

SugarCRM Customization: Email Templates with Attachments

Earlier posts on this blog have described the manner in which one can send email messages via SugarCRM, with one example going as far as demonstrating the manner in which one can use an email template in the process.

In the case of the latter, people often times wonder if it is possible to include attachments with the message. It certainly is possible and that is focus of this post. For the purposes of our example, we will assume that we are altering the above referenced example that uses a template.

Enhancing the code to accommodate attachments is actually quite easy. But before we can apply that modification we must attach the file to the template within SugarCRM.

The process for attaching it is no different than it would be for any other email template. Simply edit the email template and then attach the file. Take note of the ID value corresponding to the email template as we will need it within our code. Before we get to that point, let us take a look at what else happened when the email template was saved.

Navigate to the Notes module and notice that the file you attached to the email template has been added as a note. The entry usually has a Subject line that begins with the text "Email Attachment." This tells us two things: one, an attachment is actually a note entry related to an email template, and two, the actual file that represents the attachment is stored in the cache/upload folder. Both of these tidbits will be important to our process.

Let us begin with our modifications.

Monday, April 2, 2012

SugarCRM Troubleshooting: SMTP Problems and TMDHosting

Some months back I posted an article pertaining to SMTP connectivity problems users of Hostgator accounts may experience, resulting from network security measures applied by default to Hostgator shared hosting accounts.

I recently ran into a very similar problem with TMDHosting. Like with Hostgator, the problem manifested itself within SugarCRM through the inability to send email. Examination of the sugarcrm.log file revealed error messages indicating the connection to the SMTP server timed out.

As it turns out, TMDHosting also closes some ports for outgoing traffic on its shared hosting accounts. In this case in particular, the port in question was number 26. Thus, if you wish to use SugarCRM to connect to a server  that is listening on port 26, you should first contact TMDHosting technical support and request that they open up outgoing traffic on that port for your account.