Pages

Tuesday, October 23, 2012

SugarCRM: Imports Revisited

A few days ago I found myself in a conversation touching on a subject that made me realize there was a need to expand on a related post of mine from some time back.

The topic at hand related to importing data, which, as I discuss in that prior post, avoiding problems requires that some attention be given to the source data. Continuing this discussion, there are additional points worth mentioning about different data types.

More specifically, below are some parameters to keep in mind as you prepare your data for import:


Recipient SugarCRM Field Data Type
Source Data Format

DateTime

2012-10-23 09:30:00

Date

2012-10-23

MultiSelect

^Value^
^Value1^,^Value2^,^Value3^

Value must match the Item Name entry defined in the associated drop down list, including case.


DropDown

Value must match the Item Name entry defined in the associated drop down list, including case.


Checkbox

1 = Checked, 0 = Unchecked


Radio

1 = Selected, 0 = Unselected


I hope that helps save you some time at import time!

Wednesday, October 17, 2012

SugarCRM: Lets Go Fishing

Those of you that read my previous article describing the process for dynamically hiding subpanels may have been left wondering something about the instructions. Reading the article we find that the specific bit of code that hides the subpanel reads as follows:

unset($layout_defs['Accounts']['subpanel_setup']['opportunities']);

In the above, the subpanel for Opportunities data on the Accounts module is being suppressed. But how does one come about knowing the name of the array to manipulate? Further to this, where did the value of 'opportunities' come from? What are the rules for the other panels?

Fortunately, the answers to those questions are all found in one file: subpaneldefs.php

This file can be found in <sugar_root>/modules/<module>/metadata. For our referenced example, suppressing the Opportunities subpanel on Accounts records, the corresponding subpaneldefs.php file that contains our answers is located in <sugar_root>/modules/Accounts/metadata.

Said file will contain a listing of all the defined subpanels for the Accounts module, along with various parameters that are used to display them. To manipulate the elements, create a layoutdefs.ext.php file, as with suppressing the subpanel, focusing on the specific elements of the array that you wish to change.

Don't forget to run a Quick Rebuild and Repair to apply any changes you wish to introduce via layoutdefs.ext.php.