Skip to content

Instantly share code, notes, and snippets.

@esimonetti
Last active February 9, 2016 11:21
Show Gist options
  • Save esimonetti/192f02635651e8b96d91 to your computer and use it in GitHub Desktop.
Save esimonetti/192f02635651e8b96d91 to your computer and use it in GitHub Desktop.
Execute custom code after loading a SugarCRM case with high priority on the record view (custom/modules/Cases/clients/base/views/record/record.js) - Gist created for: https://community.sugarcrm.com/sugarcrm/topics/excute_javascript_once_page_is_fully_loaded_in_sugar_7
({
extendsFrom: 'RecordView',
initialize: function(options)
{
this._super('initialize', [options]);
},
_render: function()
{
this._super('_render');
this.myCustomLogicOnCases();
},
myCustomLogicOnCases: function()
{
// when case priority is High...
if(this.model.get('priority') == 'P1')
{
// log something on the console
console.log('executing my custom action for cases with high priorities...');
}
},
_dispose: function()
{
this._super('_dispose');
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment