Results 1 to 4 of 4

Thread: Editing export parameters

  1. #1
    petecorbs is offline Senior Member
    Join Date
    Dec 2008
    Posts
    24

    Default Editing export parameters

    Hi
    I have created a custom module that handles bookings coming into a hotel. Everything is fine apart from my last task which is to customize the export function.

    The module needs to produce an exported csv file relative to the clients that have checked in for house keeping etc etc.

    My question is that i would like to export just certain columns from the db, like client name, room number, check in date etc etc. many of the other fields are not required such as flight arrival times and created by etc.

    How can i edit this custom module just to output what i want and not the entire table, i have looked at export.php and export_utils.php but they just seem to only control contacts and accounts, also in my module bookings/bookings.php there is no function create_export_query in the code to edit like there is in leads or accounts.

    Any help or a tutorial would be great.
    Thanks

  2. #2
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Editing export parameters

    Simply create the create_export_query method in you module's class - the fact that is its not there just means it inherits the default behavior from the SugarBean parent object.

    The you can create the export query just as you want it.
    Just make sure the method takes the same arguments as SugarBean::create_export_query.

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  3. #3
    petecorbs is offline Senior Member
    Join Date
    Dec 2008
    Posts
    24

    Default Re: Editing export parameters

    Hi
    So simply cut and past the query into my bookings.php file and change the relevant fields i want to export.
    Is it thats simple?

    Thanks

  4. #4
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Editing export parameters

    It is not quite as simple as you make it sound.

    You have to cut and paste the create_export_query method and then modify it to build the query the way you want it to be.

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Editing accounts export fields
    By bunglesan in forum Help
    Replies: 3
    Last Post: 2010-05-08, 07:49 PM
  2. Custom export function or logic hook for export?
    By ivit in forum Developer Help
    Replies: 1
    Last Post: 2009-03-22, 08:22 PM
  3. Replies: 0
    Last Post: 2008-04-16, 12:04 PM
  4. Replies: 0
    Last Post: 2007-09-11, 05:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •