Skip to content

Instantly share code, notes, and snippets.

{
"grant_type":"password",
"client_id":"sugar",
"client_secret":"",
"username":"admin",
"password":"password",
"platform":"myspecialapp" // change 'myspecialapp' to whatever you want to refer to your app as
}
@jmertic
jmertic / pm-record-logic.js
Created July 30, 2014 15:43
pm-record-logic.js for this blog post http://wp.me/p419c4-2SB
initialize: function(options) {
this._super("initialize", arguments);
this.context.on('button:pm_record_reports:click', this.pmRecordReports, this);
},
@jmertic
jmertic / record.php
Created July 30, 2014 15:46
record.php for this blog post http://wp.me/p419c4-2SB
<?php
require_once('clients/base/views/record/record.php');
foreach($viewdefs['base']['view']['record']['buttons'] as &$set){
if( $set['type'] == 'actiondropdown' && $set['name'] == 'main_dropdown'){
$set['buttons'][] = array(
'type' => 'rowaction',
'event' => 'button:pm_record_reports:click',
'name' => 'pm_record_reports',
@jmertic
jmertic / record.php
Created July 30, 2014 15:49
./custom/clients/base/views/record/record.php for this blog post http://wp.me/p419c4-2SB
<?php
require_once('clients/base/layouts/record/record.php');
if(isset($viewdefs['base']['layout']['record']['components'])){
foreach($viewdefs['base']['layout']['record']['components'] as &$subArray){
if(isset($subArray['layout']['components'])){
foreach($subArray['layout']['components'] as &$subsubArray){
if(isset($subsubArray['layout']['components'])){
$subsubArray['layout']['components'][] = array(
'layout' => 'pm-record-logic',
@jmertic
jmertic / pm-record-logic.php
Created July 30, 2014 15:50
pm-record-logic.php for this blog post http://wp.me/p419c4-2SB
<?php
$viewdefs['base']['layout']['pm-record-logic'] = array(
'type' => 'simple',
'components' => array(
array(
'view' => 'pm-record-logic',
),
),
);
@jmertic
jmertic / pm-record-logic.hbs
Created July 30, 2014 15:51
pm-record-logic.hbs for this blog post http://wp.me/p419c4-2SB
<div id="pm-record-logic">
</div>
@jmertic
jmertic / pm-record-logic.js
Created July 30, 2014 15:54
pm-record-logic.js for this blog post http://wp.me/p419c4-2SB
({
className: 'pm-record-logic tcenter',
initialize: function(options) {
this._super("initialize", arguments);
this.context.on('button:pm_record_reports:click', this.pmRecordReports, this);
},
pmRecordReports: function() {
var object_id = this.model.get('id');
var object_name = this.model.attributes._module;
app.api.call('GET', app.api.buildURL('PM_ProcessManager/' + object_id + '/record_reports/' + object_name), null, {
<input ... width="6" maxlength="20" />
if ($bean->fetched_row['my_field'] !== $bean->my_field) {
// Do custom logic
}
<?php
require_once('modules/SugarFeed/feedLogicBase.php');
class NoteFeed extends FeedLogicBase
{
public $module = 'notes';
public function pushFeed($bean, $event, $arguments)
{