Skip to content

Instantly share code, notes, and snippets.

({
/*Disabling button ,condition based or dynamically on RecordView.
* AjayKumar
* custom/modules/Accounts/clients/base/views/record/reord.js
*/
extendsFrom:'RecordView',
initialize:function(options){
this._super('initialize',[options]);
this.on('render',this.makedisableButton,this);
},
<?php
/*Setting Label for button
* AjayKumar
* custom/Extension/modules/Accounts/Ext/Language/en_us.check_button.php
*/
$mod_strings['LBL_CHECK_BUTTON_LABEL']='Checking router record';
array(
'type'=>'rowaction',
'event'=>'button:check_button:click',
'name'=>'check_button',
'label'=>'LBL_CHECK_BUTTON_LABEL',
'acl_action'=>'view',
),
@AjayKumar01
AjayKumar01 / record.js
Last active May 29, 2016 05:05
Adding Shortcut name in record.js
/*custom/modules/Accounts/clients/base/layouts/record/record.js
* Ajay Kumar
*/
({
plugins: ['ShortcutSession'],
shortcuts: ['Sidebar:Toggle', 'Record:Edit', 'Record:Delete', 'Record:Save', 'Record:Cancel', 'Record:Previous', 'Record:Next', 'Record:Favorite', 'Record:Follow', 'Record:Copy', 'Record:Action:More', 'Record:Test']
})
({
/*Registering Button action for Keyboard shortcut
* Ajay Kumar
* custom/modules/Accounts/clients/base/views/record/reord.js
*/
extendsFrom: 'RecordView',
initialize: function(options) {
this._super('initialize', [options]);
this.events = _.extend({}, this.events, {
'click a[name=test_button]': '_testAlert',
<?php
/*
*custom/Extension/modules/Accounts/Ext/clients/base/filters/basic/FilerAccountTemplate.php
* Ajay Kumar
*/
$viewdefs['Accounts']['base']['filter']['basic']['filters'][] = array(
'id' => 'FilterAccountTemplate',
'name' => 'LBL_FILTER_ACCOUNT_TEMPLATE',
'filter_definition' => array(
'name' => array(
<?php
$mod_strings['LBL_FILTER_ACCOUNT_TEMPLATE']='Accounts without Current Account';
({
extendsFrom: 'RelateField',
initialize: function(options) {
this._super('initialize', [options]);
},
getFilterOptions: function(force) {
if (this._filterOptions && !force) {
return this._filterOptions;
}
//Defining our filter definitions
@AjayKumar01
AjayKumar01 / subpanel-list.js
Created April 9, 2016 07:15
Disabling edit button and un link button action based on parent module field value.
({
/* Disabling edit button and un link button action based on parent module field value.
* Ajay Kumar
* Path: sugar/custom/modules/Leads/clients/base/views/subpanel-list/subpanel-list.js
*/
extendsFrom: 'SubpanelListView',
initialize: function(options) {
this._super('initialize', [options]);
this.on('render', this._disableActions, this);
},
@AjayKumar01
AjayKumar01 / panel-top.js
Created April 9, 2016 07:20
Disabling create and link existing button action in subpanel based on parent module.
({
/* Disabling create and link existing button action in subpanel based on parent module.
* Ajay Kumar
* Path : sugar/custom/modules/Leads/clients/base/views/panel-top/panel-top.js
*/
extendsFrom: 'PanelTopView',
initialize: function(options) {
this._super('initialize', [options]);
var industryValue = this.context.parent.get('model').get("industry");
var parentModule = this.context.parent.get('module');