Results 1 to 3 of 3

Thread: Filed Relationship in related custom modules

  1. #1
    vipin.sehgal is offline Junior Member
    Join Date
    Sep 2007
    Posts
    4

    Default Field Relationship in related custom modules

    Hello,
    I started working on Sugar just few months back. So , my doubt may seems to be very silly to all you experts. Could any one please help me in solving my problem , which goes like this..
    I have two modules as "Order" and "Placement". The "Order" has an attribute "IO_ID" and Placement also has the same "IO_ID" attribute. I have related the module "Order" with "Placement", such that corresponding to one "Order" instance , I can add an instance of "Placement".
    Now , when i add an instance of "Placement" corresponding to an "Order Instance " I want to fetch the "IO_ID" Value to the corresponding "IO_ID" filed in the "Instance of Placement" . SO as to maintain consistency.


    Could Any one please help me in doing this .

    Thanking You,

    Vipin Sehgal
    (India)
    Last edited by vipin.sehgal; 2008-02-23 at 04:28 AM.

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: Field Relationship in related custom modules

    Without actually seeing the code for the two modules it's hard to be exact but you should be able to load the related order and pull out the id in the Placement.php file (or whatever module builder called your main PHP bean file).

    You should be able to override the fill_in_relationship_fields() function or the fill_in_additional_parent_fields() function or maybe the fill_in_additional_detail_fields() function. Will take a little bit of experimenting to get it to work but it might look like this

    PHP Code:
     function fill_in_additional_detail_fields() {
        
    parent::fill_in_additional_detail_fields();
        
    $sub_focus=new Order();
        
    $sub_focus->retrieve($this->related_order); //not sure how the two mods are related
       
    $this->od_id=$sub_focus->od_id;

    Of course that is completely blind code, no idea what your relationships or real modules names are.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  3. #3
    vipin.sehgal is offline Junior Member
    Join Date
    Sep 2007
    Posts
    4

    Default Re: Filed Relationship in related custom modules

    Thanks a lot, Kenneth.
    I'll try to see if that is working for me.
    Vipin

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. upgraded to 4.5.1e, received "Metadata for table tracker does not exist"
    By sfgeorge in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-09-03, 02:24 PM
  2. problemi step 6 di SugarSuite-Full-4.0.1h
    By lucia in forum Italiano
    Replies: 0
    Last Post: 2006-12-27, 08:50 AM
  3. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  4. Replies: 7
    Last Post: 2006-06-06, 07:56 PM
  5. 4.0.1 Installation Problem
    By clawton in forum Help
    Replies: 14
    Last Post: 2006-02-13, 04:17 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
  •