Skip to content

Instantly share code, notes, and snippets.

View maxieayala's full-sized avatar
👋

Maxie Ayala maxieayala

👋
View GitHub Profile
{{ $var }} - Echo content
{{ $var or 'default' }} - Echo content with a default value
{{{ $var }}} - Echo escaped content
{{-- Comment --}} - A Blade comment
@extends('layout') - Extends a template with a layout
@if(condition) - Starts an if block
@else - Starts an else block
@elseif(condition) - Start a elseif block
@endif - Ends a if block
@maxieayala
maxieayala / index.php
Created November 3, 2022 15:44 — forked from osin/index.php
SugarCRM REST API call examples
<?php
/**
* SugarCRM RESTS API Call examples
*
* REST API Wrapper - https://github.com/asakusuma/SugarCRM-REST-API-Wrapper-Class
*/
?>
<!doctype html>
<head>
<meta charset="utf-8">
<?php
function process()
{
// Custom SQL
$lvsParams = array(
'custom_select' => ',calls.id AS call_id',
'custom_from' => ' LEFT JOIN calls ON calls.parent_id = accounts.id',
'custom_where' => ' AND (calls.id IS NULL)',
'distinct' => true
Add a Custom Field to a SugarCRM Module and execute custom PHP code in that field on the DetailView.
Is a 2 step process.
1) Have to modify the detailviewdefs.php file and add a CustomCode to your field in this file...
/custom/modules/<MODULE-NAME_FOLDER>/metadata/detailviewdefs.php
set a variable in a customCode key/value like this...
'customCode' => '{$STATUS}',
@maxieayala
maxieayala / sugarquery-having.php
Created July 25, 2022 15:04 — forked from jbartek/sugarquery-having.php
SugarQuery - Having
<?php
$query = new SugarQuery();
$query->from(BeanFactory::getBean('Accounts'));
$query->join('contacts', array('alias' => 'industryContacts'));
$query->join('opportunities', array('relatedJoin' => 'industryContacts', 'alias' => 'contactsOpportunities'));
$query->select()->setCountQuery();
$query->where()->equals('contactsOpportunities.sales_stage', 'closed');
$havingCondition = new SugarQuery_Builder_Condition($query);
$havingCondition->setField('contactsOpportunities.amount')->setOperator('>')->setValues('1000');
$query->having($havingCondition);