HOWTO: Customize the export functionality for a module

sugarcrmdevelopers —  September 13, 2011 — 3 Comments

I’ve seen a few questions lately regarding customizing the fields that are listed when you use the ‘Export’ functionality in a module. The easiest way to do this is by providing your own query to use in the module’s bean method create_export_query(), but this isn’t upgrade-safe for any of the out of the box modules. However, there is an upgrade-safe way to do this, although it’s a bit more indepth, which our resident Sugar Hero andopes points out below ( from this post ):

You can create the script custom/modules/Leads/entry_point_registry.php containing something like that:

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

$entry_point_registry['export'] = array('file' => 'custom/modules/Leads/export.php', 'auth' => true);
?>

The script custom/modules/Leads/export.php should be similar to default export.php. Inside this script you need to call a customized export (defined in include/export_utils.php). You can defined then which fields to export.

3 responses to HOWTO: Customize the export functionality for a module

  1. 

    Hi john,
    do you please explain how to create that customized export in exort.php, some code sample . I need to avoid “ID” field from “Cases” module .

    Thanks
    Anes

  2. 

    Hi john,
    do you please explain how to create that customized export in exort.php, some code sample.

Trackbacks and Pingbacks:

  1. Campaign Name instead of Campaign ID on lead export - October 23, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s