Results 1 to 4 of 4

Thread: Custom Bean File Parent::save help please!

  1. #1
    mipapage is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Spain
    Posts
    90

    Default Custom Bean File Parent::save help please!

    Hi there,

    We have some custom modules. Module A is one-to-many Module Z, such that there is a listview of Module Z present in Module A.

    Now, we have some Custom Bean work being done in the {module}.php file of Module A, extending the module_sugar class. In that we have:

    Code:
    function save($check_notify = FALSE) {
    // Some logic here
    parent::save;
    }
    This custom logic works well. However, when we try and add an entry of Module Z to Module A, the data for Module Z is saved, but the relationship between the two is not stored.

    If we remove the custom Save, the relationship saves properly. So, do we have to manually update/save the relationship in this case, or is there a function that I can fire that will handle this for us?
    Sugar 6.XX Pro Onsite
    Apache 2.0, PHP 5.25, mySQL 5.0
    64-bit OS, Red-Hat, 16G ram, dual quad core.
    xcache op-code cache, mod_deflate, memory_limit = 360M, max_execution_time = 120
    > 40 users, ~500,000 leads, same #opps, 1 account, 1 contact, 2M calls.

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Custom Bean File Parent::save help please!

    I workaround for this problem is instead of customize save function use a logic_hook on before_save event.
    Then you can process your logic and use the standard save function.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    lijith's Avatar
    lijith is offline Sugar Community Member
    Join Date
    Jun 2009
    Location
    India
    Posts
    67

    Default Re: Custom Bean File Parent::save help please!

    To setup a relatioship dynamcally refer the link SugarCRM: Set relationship dynamically « Php Bugs
    Lijith M Gopinath
    email : phpbugs@live.com
    website : PHP-Bugs

  4. #4
    mipapage is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Spain
    Posts
    90

    Default Re: Custom Bean File Parent::save help please!

    Thank you both for the answers.

    1. I'm not a fan of using those hooks as it becomes more complicated setting up the manifest files and the like for subsequent deploys and avoiding overwriting of the custom code...
    2. As for the relationship, that is already built via Studio.

    It seems that by custom coding save we're overwriting something in the Sugar Bean that normally handles this, so we are just going to code these bits in by hand to our save method.
    Sugar 6.XX Pro Onsite
    Apache 2.0, PHP 5.25, mySQL 5.0
    64-bit OS, Red-Hat, 16G ram, dual quad core.
    xcache op-code cache, mod_deflate, memory_limit = 360M, max_execution_time = 120
    > 40 users, ~500,000 leads, same #opps, 1 account, 1 contact, 2M calls.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Newbie and Custom Bean File Madness
    By work77 in forum Developer Help
    Replies: 1
    Last Post: 2010-09-02, 11:53 AM
  2. custom bean file issue
    By amith sai in forum Developer Help
    Replies: 1
    Last Post: 2009-10-09, 03:46 PM
  3. Replies: 0
    Last Post: 2008-07-15, 07:20 PM
  4. Replies: 6
    Last Post: 2008-04-17, 11:05 AM
  5. Logic Hook - bean parent
    By nadigo in forum Developer Help
    Replies: 5
    Last Post: 2007-10-21, 03:10 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
  •