Skip to content

Instantly share code, notes, and snippets.

@elchele
elchele / detail.hbs
Created Jun 4, 2021
Remove "Download All" button from Notes attachments field.
View detail.hbs
{{!--
File: ./custom/modules/Notes/clients/base/fields/multi-attachments/detail.hbs
--}}
<div class="select2-container select2-container-multi select2-choices-pills-close
select2 span12 multi-attachments-detail-view">
<ul class="select2-choices">
{{#each value}}
<li class="select2-search-choice">
@elchele
elchele / cw7.cs
Last active Nov 23, 2020
Base C# class for interacting with Sugar 7 REST v10 API
View cw7.cs
/* SugarCRM v7 REST API Wrapper
*
* Date: May 13, 2014
*
* Author: Angel Magaña
*
* Contact: cheleguanaco[at]cheleguanaco.com
* cheleguanaco.com
*
*
View MyCustomApi.php
<?php
/* File: ./custom/clients/base/api/MyCustomApi.php */
class MyCustomApi extends SugarApi {
public function registerApiRest() {
return array(
'myCustomMethod' => array(
'reqType' => 'GET',
@elchele
elchele / record.js
Created May 20, 2015
Custom record view controller for setting entire record to read-only conditionally
View record.js
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/modules/Opportunities/clients/base/views/record/record.js
*
* Set all fields to read-only conditionally
*/
extendsFrom: 'RecordView',
_renderHtml: function(){
@elchele
elchele / email.ext.php
Created Jun 26, 2019
Example on leveraging PMSE Email Template Engine and Sugar Mailer to send parsed email messages
View email.ext.php
<?php
/* File: ./custom/Extension/modules/Accounts/Ext/LogicHooks/email.ext.php */
$hook_array['after_save'][] = array(
102,
'Send email test',
'custom/modules/Accounts/pmseSend.php',
'emailTest',
'emailTest'
@elchele
elchele / file.js
Created Jun 18, 2019
Debugging file upload issues
View file.js
({
/* File: ./custom/clients/base/fields/file/file.js */
extendsFrom: 'FileField',
_doValidateFileError: function(fields, errors, callback, resp) {
app.alert.dismiss('upload');
app.logger.fatal(resp);
@elchele
elchele / record.js
Created Feb 21, 2015
Custom controller for automatically uppercasing last_name value when field loses focus
View record.js
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/modules/<Module>/clients/base/views/record/record.js
*
* Custom RecordView controller for automatically converting
* last_name value to upper when focus is lost
*/
extendsFrom:'RecordView',
@elchele
elchele / record.js
Last active Jan 10, 2019
Custom record view controller, changes CSS on a given field based on number of subpanel child records linked to current record
View record.js
({
/* File: ./custom/modules/Accounts/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
initialize: function(options){
this._super('initialize', [options]);
this.model.on('data:sync:complete', this.styleType, this);
},
@elchele
elchele / conversion-stats.js
Last active Jan 4, 2019
Custom pie chart for Sugar 7.x, displaying monthly lead conversion statistics.
View conversion-stats.js
({
/* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* File: ./custom/clients/base/views/conversion-stats/conversion-stats.js
*
* controller for 'Monthly Lead Conversion Stats' custom pie chart
*/
plugins: ['Dashlet', 'Chart'],
className: 'conversion-stats',
@elchele
elchele / detail.hbs
Last active Aug 17, 2018
Custom Sidecar field component for displaying related data
View detail.hbs
{{!--
/* File: ./custom/clients/base/fields/related-info/detail.hbs
* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* Date: August 17, 2018
*
* Description: Handlebars template for related info field component
*/
--}}
{{#each fields}}