Skip to content

Instantly share code, notes, and snippets.

@elchele
elchele / detail.hbs
Created June 4, 2021 21:28
Remove "Download All" button from Notes attachments field.
{{!--
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 November 23, 2020 06:20
Base C# class for interacting with Sugar 7 REST v10 API
/* SugarCRM v7 REST API Wrapper
*
* Date: May 13, 2014
*
* Author: Angel Magaña
*
* Contact: cheleguanaco[at]cheleguanaco.com
* cheleguanaco.com
*
*
<?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 03:58
Custom record view controller for setting entire record to read-only conditionally
({
/* 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 June 26, 2019 21:10
Example on leveraging PMSE Email Template Engine and Sugar Mailer to send parsed email messages
<?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 June 18, 2019 23:06
Debugging file upload issues
({
/* 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 February 21, 2015 03:03
Custom controller for automatically uppercasing last_name value when field loses focus
({
/* 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 January 10, 2019 03:39
Custom record view controller, changes CSS on a given field based on number of subpanel child records linked to current record
({
/* 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 January 4, 2019 12:34
Custom pie chart for Sugar 7.x, displaying monthly lead conversion statistics.
({
/* 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 August 17, 2018 19:03
Custom Sidecar field component for displaying related data
{{!--
/* 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}}