Skip to content

Instantly share code, notes, and snippets.

View betobaz's full-sized avatar

Betobaz betobaz

  • Betobaz
  • Veracruz, Mexico
View GitHub Profile
@betobaz
betobaz / Request
Created May 27, 2014 16:33
SugarCRM::ApiRest::Filter Or
https://<sugarinstance>/rest/v10/Accounts/filter/?
filter[1][date_entered][$dateBetween][]=2014-05-24
&filter[1][date_entered][$dateBetween][]=2014-05-27
&fields=id,no_cliente_c
&filter[0][$or][][no_cliente_c]=1563
&filter[0][$or][][no_cliente_c]=1280
&filter[0][$or][][no_cliente_c]=1443
&filter[0][$or][][no_cliente_c]=3078
&filter[0][$or][][no_cliente_c]=10266
&filter[0][$or][][no_cliente_c]=1654
@betobaz
betobaz / existencias.hbs
Last active August 29, 2015 14:04
SugarCRM::Dashlet existencias
<style>
.table-existencia td:nth-child(4),
.table-existencia td:nth-child(6),
.table-existencia td:nth-child(7),
.table-existencia th:nth-child(4),
.table-existencia th:nth-child(6),
.table-existencia th:nth-child(7){
text-align:right;
}
({
extendsFrom: 'RecordView',
initialize: function (options) {
this._super('initialize', arguments);
debugger;
this.model.on("change:solucion_c",this.calculate, this);
},
calculate:function() {
var solucion_c = this.model.get('solucion_c');
<?php
$viewdefs['Accounts']['base']['layout']['nrfm'] = array(
'type' => 'simple',
'components' => array(
array(
'view' => 'nrfm',
),
),
);
?>
<?php
$dictionary['Account']['visibility'] = array(
"OwnedByTeamField" => true,
);
@betobaz
betobaz / record.php
Created February 18, 2015 19:42
SugarCRM sidecar retrieve fields' value that aren't visible in a view
<?php
$viewdefs['Leads']['base']['view']['record'] = array(
'buttons' => array(
.
.
.
),
'panels' => array(
.
.
@betobaz
betobaz / custom__clients__base__views__list-bottom__list-bottom.js
Last active August 29, 2015 14:23
SugarCRM::Sidecar::list-bottom::Remove loading message
/*
* Your installation or use of this SugarCRM file is subject to the applicable
* terms available at
* http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/.
* If you do not agree to all of the applicable terms or do not have the
* authority to bind the entity as an authorized representative, then do not
* install or use this SugarCRM file.
*
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
@betobaz
betobaz / README.md
Last active August 29, 2015 14:24
SugarCRM :: create-actions :: dashlet :: add drawer close callback

test

({
getRecordsRecursive: function(moduleName, filters, offset, collectionBuffer, callback){
var self = this;
if(offset > -1){
var collection = App.data.createBeanCollection(moduleName);
var req = collection.fetch({"filter": filters, "offset": offset});
req.xhr.success(function(data){
if(data.records){
collectionBuffer.add(data.records);
self.getRecordsRecursive(moduleName, filters, data.offset, collectionBuffer, callback);
@betobaz
betobaz / trigger-preview.js
Created July 14, 2015 00:01
SugarCRM::Sidecar::Show model in preview
({
showPreview: function(moduleName, modelId){
var bean = App.data.createBean(moduleName, {id:modelId});
bean.fetch();
App.events.trigger('preview:render', bean);
}
})