Skip to content

Instantly share code, notes, and snippets.

View mehulsbhandari's full-sized avatar

Mehul Bhandari mehulsbhandari

View GitHub Profile
@AjayKumar01
AjayKumar01 / subpanel-list.js
Last active April 26, 2022 19:14
Limiting the subpanel records based on parent module
({
/**
* Purpose:Limiting the subpanel records based on parent module
* Here we are limiting contacts module records based on parent module(Opporunities,Accounts and other module) *
* Path : sugar/custom/modules/contacts/clients/base/views/subpanel-list/subpanel-list.js
* Written by: Ajay Kumar
* Dated: 31 May 2016
*/
extendsFrom:'RecordlistView',
fallbackFieldTemplate: 'list',
({
/*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);
},
@dmulvi
dmulvi / fullname.js
Last active February 9, 2017 22:20
SugarCRM 7 - add fields to Full Name headerpane display (middle name, nick name, preferred name etc)
/*
* I only wanted to apply this change to the Contacts modules so I put this file in:
* custom/modules/Contacts/clients/base/fields/fullname/
*/
({
extendsFrom: 'FullnameField',
formatMap: {
'f': 'first_name',
'l': 'last_name',
@elchele
elchele / record.js
Created January 29, 2016 21:00
Custom RecordView controller for checking if a specific related record(s) exists in a subpanel at time parent record is viewed.
({
/* File: ./custom/modules/<Module>/clients/base/views/record/record.js */
extendsFrom: 'RecordView',
initialize: function(options){
/* Check if related module has records linked to current record and meet a specific criteria (filter)
* You need the "link" field name from vardefs for the specific
* subpanel you wish to check.
*
@chadhutchins
chadhutchins / script.php
Last active June 29, 2016 05:32
SugarOutfitters Starter Webhook Script
<?php
// get the webhook response
$body = @file_get_contents('php://input');
// decode the json data into a php object
$response = json_decode($body);
// the webhook property tells us exactly which webhook event was fired
// so let's create a case for a few webhooks