Skip to content

Instantly share code, notes, and snippets.

View carloszaragoza's full-sized avatar
💭
I may be slow to respond.

Carlos Zaragoza carloszaragoza

💭
I may be slow to respond.
  • USA
View GitHub Profile
@carloszaragoza
carloszaragoza / api.js
Created March 22, 2017 22:59
Cómo hacer una llamada por medio de un controlador desde SugarCRM
App.api.call(‘create’, App.api.buildURL(null, ‘bulk’) ,
{
requests :
[{
url: “/v10/Accounts”, method: “GET”
}]
},
{
success: function (data) { console.log(data)}
});
@carloszaragoza
carloszaragoza / dashlet-dos.js
Created July 29, 2016 15:54
Eventos personalizados entre dos dashlets | Custom events between two dashlets
initDashlet: function (options) {
this.context.on('eventoPersonalizado', function (link) {
console.log("Mensaje desde dashlet uno");
console.log(link);
});
}
@carloszaragoza
carloszaragoza / create-actions.js
Created December 23, 2015 22:19
Remove Button Duplicate in a module, this is in a custom
setButtonStates:function(state){
this._super("setButtonStates",[state]);
var $saveButtonEl=this.buttons[this.saveButtonName];
if($saveButtonEl){
switch(state){
case this.STATE.CREATE:
case this.STATE.SELECT:
$saveButtonEl.getFieldElement().text(app.lang.get('LBL_SAVE_BUTTON_LABEL',this.module));
break;
case this.STATE.DUPLICATE:
@carloszaragoza
carloszaragoza / queryToObject.js
Created May 23, 2013 18:15
This gist to convert a json object to objects separated by rows
var queryToObject = function(q) {
var col, i, r, _i, _len, _ref, _ref2, _results;
_results = [];
for (i = 0, _ref = q.ROWCOUNT; 0 <= _ref ? i < _ref : i > _ref; 0 <= _ref ? i++ : i--) {
r = {};
_ref2 = q.COLUMNS;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
col = _ref2[_i];
r[col.toLowerCase()] = q.DATA[col][i];
}
@carloszaragoza
carloszaragoza / export2csv.cfm
Created October 29, 2012 21:36
Export data to CSV from ColdFusion
<!--- Read data from two datasource tables. --->
<cfquery
name="iae1" datasource="escolar_db13">
select * from v_rc_iae_pr1
</cfquery>
<cfscript>
//Use an absolute path for the files. --->
theDir=GetDirectoryFromPath(GetCurrentTemplatePath());
theFile=theDir & "exportData.xls";
//Create two empty ColdFusion spreadsheet objects. --->