View Full Version : 100 Tutorials To A SugarCRM Cookbook
josh.sweeney
2008-07-31, 02:24 PM
I want your real world tutorials!! SugarCRM needs a cookbook. If you have ever read PHP Cookbook or C# Cookbook then you know what I mean. It is a book with nothing but real world examples on how to get things done in a language or software package.
Here is the challenge: I have only written a few tutorials myself so I need your help. If everyone can turn their hacks and addons into a tutorial and submit it to me then I will format it, check it, edit it, combine exmaples, and do all of the other duties to produce the first SugarCRM Cookbook. Then I will deliver in PDF back to the community.
The requirements:
1. All tutorials must work in 5.x
2. Tutorials can be 1 to 15 pages, all code needs to be included in the tutorial.
3. Once I get to 100 tutorials or 1000 pages I will publish it to the community.
4. It needs to include step by step instructions that have been checked on a clean instance.
5. Needs to include who it was written by and specify whether or not it is upgrade safe.
6. Screenshots are welcome.
If you have a tutorial then please attach it to your post and I will grab it. Please put the title in your post so that other can see what it is about.
Any takers?
eggsurplus
2008-07-31, 02:31 PM
Wow, sure. It may take awhile though.
DragonflyMaster
2008-07-31, 04:27 PM
That would be very useful, but
1. All tutorials must work in 5.1. Why? 5.1 has not gone gold yet, maybe with 5.0x you could gather tutorials more easily...
rmbennett72
2008-07-31, 05:26 PM
I understand the desire to use the latest version of the software to create the cookbook. I also know there are enough differences between 4.X version and 5.0 to make many earlier tutorials non-compliant with a 5.0 system. However are the differences between 5.0 and 5.1 enough to draw the line between those two versions? I do not know because I have just started to adopt Sugar since 5.X has been released. So I will leave that debate to more experienced users. My vote is draw the line at 5.0 though.
That all being said can you post a link to an example tutorial that you would like others to follow?
eggsurplus
2008-07-31, 06:11 PM
Good point. Didn't see the 5.1 requirement. Not wasting my time just to check to see if it works in 5.1. I can do 5.0 though. A sample format is a good idea for submissions.
josh.sweeney
2008-07-31, 08:43 PM
I have no problem including 5.x articles. If for some odd reason they work in one and not the other then please specify.
I have attached a tutorial that I have been working on recently for reference. In the attached doc I boxed in code and highlighted code additions in blue.
josh.sweeney
2008-08-01, 05:08 AM
It may also help if people post suggestions. Here are a few:
Converting Country, State, City into dropdowns.
Calculated Fields
Utilizing Built in Flash charts in custom modules.
Building custom workflows.
Adding custom fields to Studio.
Adding TinyMCE to fields.
How to remove buttons.
LinkedIn Integration
Adding images to modules.
Many of these have been discussed in the forums but are still in thread form or spread across multiple threads. Converting these into a document form would be very helpful if you can spare the time.
josh.sweeney
2008-08-07, 08:12 PM
Here is a list of the current articles that we have.
1. Lightboxing in a detail view
2. Programmatically Hiding and Displaying Panels Based on the Value of A Drop Down in 5.1
3. Adding a FedEx Tracking Link to a Detail View in 5.x
4. Adding an Icon to Link to External Application
5. Adding a save event to track case stages
6. Adding a pre-save event to track task duration
7. How to change field level attributes
DragonflyMaster
2008-08-08, 09:58 AM
Hi Josh,
are these tuts available somewhere?
kuske
2008-08-08, 11:41 AM
Hi Josh,
are these tuts available somewhere?
Very good question, as you want to write a book (paper based I hope) I would recommend to use a Typo3 or other CMS as writing tool.
No, i did not write "WIKI", I wrote "CMS" :D
Greetings
josh.sweeney
2008-08-08, 03:30 PM
Currently I have taken all of the tutorials and put them into a document that I was going to turn into a PDF. My plan was to post SugarCRM Cookbook v0.1 once I received 10 tutorials. Then get feedback.
Fedepia's makes 8 so I just need 2 more.
josh.sweeney
2008-08-08, 07:48 PM
After working with the documents a little more I think that I can provide more insight into the format.
Here is what I have come up with.
<Title>
Author: <author name>
Built in Version: <version of sugar this was tested/built in>
Requirements: <all requirements> //third party modules, files, etc
Introduction: <intro text> //tell the what's and why's of the mod. Why's are very nice to have.
Section <number> - <section title>
<steps>
<steps>
<steps>
Section <number> - <section title>
<steps>
<steps>
<steps>
cyberdude
2008-08-09, 07:22 AM
After working with the documents a little more I think that I can provide more insight into the format.
Here is what I have come up with.
<Title>
Author: <author name>
Built in Version: <version of sugar this was tested/built in>
Requirements: <all requirements> //third party modules, files, etc
Introduction: <intro text> //tell the what's and why's of the mod. Why's are very nice to have.
Section <number> - <section title>
<steps>
<steps>
<steps>
Section <number> - <section title>
<steps>
<steps>
<steps>
I think you should also include whether it's upgrade proof.
josh.sweeney
2008-08-10, 03:05 AM
I think you should also include whether it's upgrade proof.
Good Call. How about this:
<Title>
Author: <author name>
Built in Version: <version of sugar this was tested/built in>
Upgrade Safe: <Yes:No>
Requirements: <all requirements> //third party modules, files, etc
Introduction: <intro text> //tell the what's and why's of the mod. Why's are very nice to have.
Section <number> - <section title>
<steps>
<steps>
<steps>
Section <number> - <section title>
<steps>
<steps>
<steps>
josh.sweeney
2008-08-25, 12:37 AM
Since the tutorials are being compiled from different places the document still needs more formatting but here it is. If you have any suggestions please let me know.
This is version 0.11.
DragonflyMaster
2008-08-26, 08:36 AM
Since the tutorials are being compiled from different places the document still needs more formatting but here it is. If you have any suggestions please let me know.
This is version 0.11.Well done,
I hope more tuts will follow ;)
bradym80
2008-08-28, 08:07 PM
All the documents about how to create a web to lead form do not work. They should be re-written step by step to make it clearer.
josh.sweeney
2008-09-03, 07:22 PM
Where is the tutorial on creating a web to lead form?
digitalcoresf
2008-09-03, 08:22 PM
this is great!
we are new to sugar and have been trying to "autopopulate" fields based on relate fields.
in particular, in trying to build an expense or invoice module.
we want to pick an item from the products catalog or quote/products.
then have the price, description etc fill in.
I think this is a common need for sugar newbies, and there isn't too much info available.
This would be an awesome tutorial.
thanks!
kazkawamura
2008-09-08, 03:32 AM
It is great!
This document is a woulderful resource for the SugarCRM customization.
I hope the title is more purpose-oriented.
For example, "3. Adding a FedEx Tracking ..." would be "3. Adding the custom logic on the detail view (Adding a FedEx....)".
Some titles of the topics are just what you did.
From the reader's view, we read this tutorial to look for the solutions of our SugarCRM requirements.
So, it would be great if we could recognize which topic fits our requirements easier.
dtokeefe
2008-09-08, 02:20 PM
Hi Josh,
Great idea to make a SugarCRM Cookbook. Maybe it would be easier to manage and distribute if you made the Cookbook an area of the Developer Wiki, in addition to the PDF.
Best regards,
David
josh.sweeney
2008-09-08, 05:11 PM
It is great!
This document is a woulderful resource for the SugarCRM customization.
I hope the title is more purpose-oriented.
For example, "3. Adding a FedEx Tracking ..." would be "3. Adding the custom logic on the detail view (Adding a FedEx....)".
Some titles of the topics are just what you did.
From the reader's view, we read this tutorial to look for the solutions of our SugarCRM requirements.
So, it would be great if we could recognize which topic fits our requirements easier.
I agree with you 100% and have also put some thought into this. I would like to go through each title and make them more descriptive but I would also like to make that they are not extremely long. It will just be a matter of coming up with new titles or providing subtitles. If you have proposed title changes please post them.
josh.sweeney
2008-09-08, 05:28 PM
Hi Josh,
Great idea to make a SugarCRM Cookbook. Maybe it would be easier to manage and distribute if you made the Cookbook an area of the Developer Wiki, in addition to the PDF.
Best regards,
David
Thanks. I thought of moving it to the wiki but since I try to post each tutorial to the new developers section I didn't think that it needed to be in both places. The other good thing about the forum is that you can build more of a discussion around the tutorials. If one doesn't work or someone needs help on one thing to finish it then they can ask.
j.lagos
2008-09-09, 09:01 AM
I have no problem including 5.x articles. If for some odd reason they work in one and not the other then please specify.
I have attached a tutorial that I have been working on recently for reference. In the attached doc I boxed in code and highlighted code additions in blue.
In the code you have attached, for controling forms with subpanels, I think in the line: value = value.toUpperCase()+' INFO';
there is no need to add 'INFO' word, if the panel label contains this word, for example: CUSTOMER INFO.
Otherwise, your code compares: 'CUSTOMER INFO' to 'CUSTOMER INFO INFO', which is wrong.
Thanks,
J.lagos
josh.sweeney
2008-09-09, 12:47 PM
In the code you have attached, for controling forms with subpanels, I think in the line: value = value.toUpperCase()+' INFO';
there is no need to add 'INFO' word, if the panel label contains this word, for example: CUSTOMER INFO.
Otherwise, your code compares: 'CUSTOMER INFO' to 'CUSTOMER INFO INFO', which is wrong.
Thanks,
J.lagos
Yes, it can be removed. Thank you for pointing that I out. This was left in from the first version of this code which didn't dynamically pull in the drop down values.It was hard coded and needed a designated keyword to look for such as "info." I will update the document shortly.
Please let me know if you see any other optimizations that can be made in the other tutorials.
techie001
2008-11-06, 12:01 PM
I have no problem including 5.x articles. If for some odd reason they work in one and not the other then please specify.
I have attached a tutorial that I have been working on recently for reference. In the attached doc I boxed in code and highlighted code additions in blue.
Thanks....
7ochem
2008-11-19, 10:56 AM
Great idea this Cookbook.
I also have an addition:
When searching for contacts or accounts by name, you have to enter the first part of the name (or full name). But when you have a lot of companies like “A.F. Johnson Steel Industries” then searching for “johnson steel” would be much easier.
Therefore I added a new query operator at the search ‘where’ generator named ‘containing’.
I believe that the last part, changing the metadata, can also be done in the custom folder. Is that right?
eggsurplus
2008-11-19, 12:41 PM
7ochem,
All you need to do is search for "%johnson steel" and you'll find what you're looking for. The % support is built in as it just does a LIKE query against the database.
7ochem
2008-11-19, 02:30 PM
Of course, but besides this didn't work for some reason, most of the employees in companies do not understand the % character. The use of an * could also be implemented, but this is often also rejected. This issue comes down to the human centered versus data centered ICT discussion. The system has to comply to the users need, not the other way around.
So for all the admins with users who refuse to understand the use of % or *: SearchWithin ;)
Hi Josh!
A Sugar cookbook is a really sweet idea! :p
However I had some troubles with your "Lightboxing" recipee.
Following the instructions I was able to get the lightbox up, but the closing link would not work,
neither in FF3 or IE7.
(The closing link would "work" if I right-clicked it and opened in a new window though ....)
When I changed the closing link from:
<a href="#" class="lbAction" rel="deActivate">Close Lightbox</a>
to:
<a href="" class="lbAction" rel="deActivate">Close Lightbox</a>
it worked as expected both in FF3 and IE7.
(btw, a minor thing, I've never seen </br> tags before, I don't believe that's correct html)
Please, keep the tutorials coming... :)
I would like a tutorial on
how to call a custom popup window, and from that bring back one or more values to the calling window.
(Just like you can get Team or Assigned To through the Select-button in most modules)
Aespejo
2009-01-13, 07:44 AM
Great thanks for these tutors I begin with sugar and they have been of big help these tutors. You have I throw the biggest work, you have made me happy the day, I am like madman proving everythingn :p
andrewdh
2009-01-31, 01:22 PM
This thread is proving to be brilliant stuff - thanks to Josh :D
I need exactly this with a few extra bells and whistles : MY NEEDS BELOW IF ANYONE CAN ASSIST
I would like a tutorial on
how to call a custom popup window, and from that bring back one or more values to the calling window.
(Just like you can get Team or Assigned To through the Select-button in most modules)
My needs:
I want every Lead, Opportunity and Account to belong to a SALES_ZONE, Sales Territory is another way of putting this.
However the Sales_Zone value will only be allowed by a lookup to a Custom Module (TOWN_Zone) that has been propagated with every town and its Postcode (ZIP) and an allocated SALES_ZONE.
If the Sales Manager changes a town into a new Sales Zone then the records in the 3 modules above need to be moved into the new Sales_Zone. Obviously the SALES_ZONE information should move through the converted process.
Any help on this would help a Sugar Newbie - just started fiddling with custom modules
This is a great thread, lots of tips, tricks and great questions.
I am putting together the 5.5 dev guide and documentation starting now and using SugarCon as a luanching pad to get things going.
If any of you are attending SugarCon grab me if you see me floating around or as the nearest Sugar employee to point me out.
I would like to organize this group and the cook book material and get it ready for the 5.5 release so it can be released/posted in conjuction with the product.
I will have more details in the up and coming weeks post SugarCon in the 5.5 forum here:
http://www.sugarcrm.com/forums/forumdisplay.php?f=151
Nate D'Amico
Sugar Product Mgmt Team
josh.sweeney
2009-01-31, 09:33 PM
This is a great thread, lots of tips, tricks and great questions.
I am putting together the 5.5 dev guide and documentation starting now and using SugarCon as a luanching pad to get things going.
If any of you are attending SugarCon grab me if you see me floating around or as the nearest Sugar employee to point me out.
I would like to organize this group and the cook book material and get it ready for the 5.5 release so it can be released/posted in conjuction with the product.
I will have more details in the up and coming weeks post SugarCon in the 5.5 forum here:
http://www.sugarcrm.com/forums/forumdisplay.php?f=151
Nate D'Amico
Sugar Product Mgmt Team
Nate,
I have all of the original, formatted Word docs that I used to create the PDF. If you need them or the combined Word doc then just let me know.
This thread is proving to be brilliant stuff - thanks to Josh
Thanks. Hopefully people will keep adding tutorials in to everyone's benefit.
kasperd
2009-02-02, 06:39 AM
Could someone post tutorial on how to put relate data not on subpanel but in editview for example similar as email field is done so we could for example add values
To andrewdh:
I'm not sure I understand your problem, but maybe this page will interest you - and maybe some other people in here too:
Add grandparent fields to your SugarCRM modules (http://www.jejik.com/articles/2008/12/add_grandparent_fields_to_your_sugarcrm_modules/), by Sander Marechal.
It also seems appropriate material to include in a Cookbook.
But please note I'm not in any way associated with the author of that page, and neither am I offering to write a tutorial.
I just thought it was worth sharing.
strongilis
2009-03-22, 07:53 PM
Hi! Great thread but its died down!!
Any more tutorials? What version of the cookbook are we in? How do we contribute? Where do we get the latest version?
Thank you
Rudi Mentär
2009-03-25, 09:34 AM
Hi
I have another great addition for your tutorial!
I added an icon on the detail-view to show the current adress on google-maps.
Here is what i added to the detailviewdefs.php in /custom/modules/Contacts/metadata/
1 => //link for google-maps
array (
'customCode' => '<br>
<br>
<table>
<tr>
<td>
<img src=".[add-an-image-]">
</td>
<td>
<a href="http://maps.google.com/maps?&q={$fields.primary_address_street.value}+{$fields. primary_address_postalcode.value}+{$fields.primary _address_city.value}" target="blank"><b>show adress on google-maps<b></a>
</td>
</tr>
</table>',
),
SugarDev.net
2009-03-29, 04:46 PM
If you want to control the SearchForm tabs from the MVC framework, you can use this upgrade-safe code.
/**
* Copyright (c) 2009 Madcap BV (http://www.madcap.nl)
* All rights reserved.
*
* Permission is granted for use, copying, modification, distribution,
* and distribution of modified versions of this work as long as the
* above copyright notice is included.
*
* @author Loek van Gool <l.vgool@madcap.nl>
*/
require_once 'include/MVC/View/views/view.list.php';
class <module_name>ViewList extends ViewList {
/**
* Remove the Advanced Search tab from the form
*/
function processSearchForm() {
$args = func_get_args();
unset($this->searchForm->tabs[1]);
$this->searchForm->nbTabs = sizeof($this->searchForm->tabs);
call_user_func_array(array('parent', __FUNCTION__), $args);
}
}
Please keep in mind that if this makes it to any Wiki page or tutorial cookbook, the above copyright and license notice needs to be kept intact.
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.