Skip to content

Instantly share code, notes, and snippets.

View mmarum-sugarcrm's full-sized avatar

Matt Marum mmarum-sugarcrm

View GitHub Profile
@mmarum-sugarcrm
mmarum-sugarcrm / gist:4170576
Created November 29, 2012 17:26
Getting a Record's info should be as simple as...
SugarClient client = new SugarClient(sugarUrl);
SugarSession session = client.getSugarSession("user", "password");
SugarBean bean = client.getBean(session, "Opportunities", "...GUID...");
System.out.println("Opportunity Name: " + bean.get("name"));
<?php
/*
* By installing or using this file, you are confirming on behalf of the entity
* subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
* the SugarCRM Inc. Master Subscription Agreement ("MSA"), which is viewable at:
* http://www.sugarcrm.com/master-subscription-agreement
*
* If Company is not bound by the MSA, then by installing or using this file
* you are agreeing unconditionally that Company will be bound by the MSA and
@mmarum-sugarcrm
mmarum-sugarcrm / custom_clients_base_layouts_record_record.php
Last active January 30, 2018 23:21
Adding a new view to base Record layout in Sugar 7
<?php
/*
* By installing or using this file, you are confirming on behalf of the entity
* subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
* the SugarCRM Inc. Master Subscription Agreement ("MSA"), which is viewable at:
* http://www.sugarcrm.com/master-subscription-agreement
*
* If Company is not bound by the MSA, then by installing or using this file
* you are agreeing unconditionally that Company will be bound by the MSA and
@mmarum-sugarcrm
mmarum-sugarcrm / custom_modules_Foo_clients_base_views_record_record.js
Created February 11, 2014 20:41
Extending the a module's Record view in Sugar 7
({
extendsFrom: 'RecordView',
/**
* Some extra functionality
*/
doSomethingCool: function() {
},
_dispose: function() {
@mmarum-sugarcrm
mmarum-sugarcrm / Extending Record View to customize prefill when a user copies a record.js
Last active November 22, 2016 09:46
custom/modules/MODULE-NAME/clients/base/views/record/record.js
({
//The below jsdoc was copied from base RecordView controller in Sugar 7.2
extendsFrom: 'RecordView',
/**
* Called when current record is being duplicated to allow customization of
* fields that will be copied into new record.
*
* Override to setup the fields on this bean prior to being displayed in
* Create dialog.
*
@mmarum-sugarcrm
mmarum-sugarcrm / filter-quicksearch.js
Created March 21, 2015 18:05
Use of _.debounce() in Sugar 7.5 filter-quicksearch.js
({
...
/**
* Fire quick search
* @param {Event} e
*/
throttledSearch: _.debounce(function(e) {
var newSearch = this.$el.val();
if(this.currentSearch !== newSearch) {
@mmarum-sugarcrm
mmarum-sugarcrm / 1-base-layout-foo.php
Created March 25, 2015 15:45
Using Name and Type in View Definitions in Sugar 7
$viewdefs['base']['layout']['foo'] = array(
'components' => array(
array(
'layout' => 'header', //reference another definition
),
array(
'layout' => array( //directly include definition
'components' => array(
array(
'view' => 'title', //reference another definition
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Created March 25, 2015 15:50
Foo layout with a component definition
$viewdefs['base']['layout']['foo'] = array(
'components' => array(
array(
'layout' => 'header', //reference another definition
),
array(
'layout' => array( //directly include definition
'components' => array(
array(
'view' => 'title', //reference another definition
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Created March 25, 2015 15:52
Foo view that includes a buttons definition
$viewdefs['base']['view']['foo'] = array(
'buttons' => array( //directly include definition
array(
'type' => 'button',
'name' => 'cancel',
),
array(
'type' => 'button',
'name' => 'save',
),
@mmarum-sugarcrm
mmarum-sugarcrm / foo.php
Last active August 29, 2015 14:17
Foo layout with a type definition that uses the foo controller
$viewdefs['base']['layout']['foo'] = array(
'components' => array(),
'type' => 'foo',
),