Skip to content

Instantly share code, notes, and snippets.

@elchele
elchele / preview.js
Created July 30, 2015 20:09
Controller for Preview view, used to conditionally hide fields on preview render.
({
/* File: ./custom/modules/Accounts/clients/base/views/preview/preview.js */
extendsFrom: 'PreviewView',
_renderPreview: function(model, collection, fetch, previewId){
var self = this;
// If there are drawers there could be multiple previews, make sure we are only rendering preview for active drawer
if(app.drawer && !app.drawer.isActive(this.$el)){
@elchele
elchele / record.js
Last active August 29, 2015 14:27
Custom Record view controller for removing fields not accessible via ACL.
({
/* File: ./custom/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
_render: function(){
var self = this;
this._super('_render');
_.each(this.noEditFields, function(field){
@elchele
elchele / record.js
Created January 22, 2016 16:57
Custom record view controller for displaying an alert upon a record being accessed, if it meets a given criteria.
({
/* File: ./custom/modules/Leads/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
initialize: function(options) {
this._super('initialize', [options]);
this.model.on('data:sync:complete', this.showAlert, this);
},
@elchele
elchele / record.js
Created January 29, 2016 19:28
Custom RecordView controller for checking number of records in a subpanel at time parent record is viewed.
({
/* File: ./custom/modules/<Module>/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
initialize: function(options){
/* Check if related module has records linked to current record
* You need the "link" field name from vardefs for the specific
* subpanel you wish to check.
*
@elchele
elchele / record.js
Created January 29, 2016 21:00
Custom RecordView controller for checking if a specific related record(s) exists in a subpanel at time parent record is viewed.
({
/* File: ./custom/modules/<Module>/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
initialize: function(options){
/* Check if related module has records linked to current record and meet a specific criteria (filter)
* You need the "link" field name from vardefs for the specific
* subpanel you wish to check.
*
@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 / LogicHookController.php
Last active March 11, 2016 01:28
Fix to Marketo logic hook correcting issue with dates and users with non-US date format
<?php
/* File: ./custom/include/externalAPI/Marketo/LogicHookController.php */
/*
* Copyright (c) 2014-2015 SugarCRM Inc. This product is licensed by SugarCRM
* pursuant to the terms of the End User License Agreement available at
* http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/10_Marketo/
*/
@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
*
*
@elchele
elchele / news.hbs
Last active July 27, 2016 21:18
Adjustment to controller for News dashlet to switch from using Google API to Google News RSS feed. Google API was retired and no longer functional.
{{!--
/* File: ./custom/clients/base/views/news/news.hbs
*
* Date: July 27, 2016
*
* Author: Angel Magaña
*
* Description: Adjustment to News dashlet Handlebars template
*
*/
@elchele
elchele / rmas.ext.php
Created September 2, 2016 18:27
Disabling ActivityStream on a specific module (Accounts) and global logic hooks that support functionality.
<?php
/* File: ./custom/Extension/modules/<Module>/Ext/Vardefs */
$dictionary['Account']['activity_enabled'] = false;
?>