Loading in 2 Seconds...
Loading in 2 Seconds...
Online Developer/User Group. The Mystical SugarBean Part 1 General Development Overview. Functional Architecture. Deployment Options:. UI Layer. Simple controller in index.php Validates and manages sessions Validates and encodes posted information Authenticates users Controls actions
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Online Developer/User GroupThe Mystical SugarBeanPart 1General Development Overview
Simple controller in index.php
Validates and manages sessions
Validates and encodes posted information
Loads detail records
Creates wrapper shell around the UI
Includes the appropriate file for the right module
Manages SOAP based Sessions
Allows Search, Retrieve, Edit, Delete.
Allows Retrieving all modified records since a given date
Used for Integrations
Plug-in for Microsoft Outlook
Wireless Client Application
Sync projects (Funambol)
Offline Client Sync
Business Object (Contact, Account, …)
High level API for manipulating business data
Abstracts away a lot of the common code from the specific modules
Designed to be Sub-classed to Support Additional Methods of Retrieving Data
SOAP or EJB From Upcoming Data Layer
Low Level database API
Provides database method signature abstraction
Allows for easier porting to different databases
Provides for some query construction
These will be growing to support more database abstraction and more database functionality
Online Developer/User GroupThe Mystical SugarBeanPart 2Custom BusinessLogic Hooks
Add Custom Business Logic to the Application
Extensions that do not risk your main code
Where is it going
Workflow in 4.0 in Professional and Enterprise Versions
Deeper event triggers for external business processes
Help process and handle custom data formats
Hook Events in 3.5.0
before_save – Before the bean is saved
after_retrieve – After a bean is retrieved
before_delete – Before a bean is deleted
after_delete – After a bean is deleted
before_restore – Before a bean is restored
after_restore – After a bean is restored
The custom logic file is located under custom/modules/[CURRENT_MODULE]/logic_hooks.php.
The details for format are in SugarBean.php function call_custom_logic
The file should only contain the specified information and should be completely replaceable
Create a before_save hook
$hook_array['before_save'] = Array(1, 'notify', 'custom/modules/Leads/test12.php', 'TestClass', 'lead_before_save_1');
Hooks are processed in the order in which they are defined.
The right hand side array defines
processing index (for sorting before exporting the array)
Reserved for future use.
php file to include
php class the method is in
php method to call
Hook method signature:
function NAME(&$bean, $event, $arguments)
$bean - $this bean passed in by reference.
$event - The string for the current event (i.e. before_save)
$arguments - An array of arguments that are specific to the event.
Online Developer/User GroupThe Mystical SugarBeanQ & A