Results 1 to 4 of 4

Thread: how to update date_modified when adding a subpanel item?

  1. #1
    Narf is offline Member
    Join Date
    Jun 2008
    Posts
    6

    Default how to update date_modified when adding a subpanel item?

    I would like to update the date_modified on a Project when an Account is added to it via the Account subpanel on the Project page. I tried adding "before_save" logic hooks to the Project and Account modules, however, they don't fire when adding via the subpanel. Is there a setting I need to adjust? If so, then where is it? Is there another way to accomplish this?

    Alternatively, is there a way to get the data from the "projects_accounts" table sorted by date_modified through the soap API ?

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: how to update date_modified when adding a subpanel item?

    The get_relationships() method should allow you to get that data, but you can't control its order. You'll have to sort it within your code if the records aren't returned in the order that you want.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    Narf is offline Member
    Join Date
    Jun 2008
    Posts
    6

    Default Re: how to update date_modified when adding a subpanel item?

    Quote Originally Posted by Angel View Post
    The get_relationships() method should allow you to get that data, but you can't control its order. You'll have to sort it within your code if the records aren't returned in the order that you want.
    It looks like the get_relationships() method only returns the relationships for a given module ID. I want the Account relationships that were added to all Projects after a given date. Using get_relationships(), wouldn't I need to get all the projects and then run get_relationships on each Project? I'd like something more efficient if possible.

  4. #4
    SugarDev.net is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    1,401

    Default Re: how to update date_modified when adding a subpanel item?

    Unless you write your own, I think you're stuck with the option you mentioned yourself..

    Also, hooking relationships is not supported but once showed on this forums, please try a search for it.
    Developers go here
    Businesses go there (Dutch)

    Modules:
    SugarDev.net Developer Tools | Config | Dutch Language Pack
    "Nothing gets fixed unless there is a bug"

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 2009-10-14, 05:36 PM
  2. Replies: 7
    Last Post: 2009-06-18, 05:27 AM
  3. What code is fired after item is added to subpanel?
    By sugar1984 in forum Developer Help
    Replies: 1
    Last Post: 2008-06-28, 07:18 PM
  4. Adding new fields to "Mass Update" subpanel
    By rickcrites in forum Feature Requests
    Replies: 17
    Last Post: 2008-01-14, 06:01 PM
  5. Subpanel item creation
    By am_baal in forum Developer Help
    Replies: 2
    Last Post: 2006-07-03, 01:46 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
  •