Results 1 to 6 of 6

Thread: Retrieving Data from other Module through Relate Field

  1. #1
    cedcas is offline Member
    Join Date
    Sep 2009
    Posts
    18

    Default Retrieving Data from other Module through Relate Field

    Hello Everyone,

    There has been a lot of posts and solutions that I've read in regards of this subject but can't quite find the one specific to my scenario. I would like to apologize ahead of time if this has been resolved in the past and would appreciate pointing me in the right directions.

    I have a need to retrieve data from MODULE B going to MODULE A (both custom modules. Here is my code snippet from EDITVIEWDEFS.php of MODULE A:

    Code:
              array (
                'name' => 'field_a',
                  'studio' => 'visible',
                  'label' => 'LBL_FIELD_A',
                  'validateDependency'=>false,         
                'displayParams' => 
                   array (
                  'field_to_name_array' => 
                      array (
                       'name' => 'field_a',
                       'from_field_b' => 'field_b',
                       'from_field_c' => 'field_c',
                       'from_field_d' => 'field_d',
                       'from_field_e' => 'field_e',
                       'from_field_f' => 'field_f',
                       'from_field_g' => 'field_g',
                            ),
                         ),
                    ),
    The code above does what its suppose to do in terms of retrieving values from MODULE B but here is what's happening post-retrieved:
    • FIELD A along with the rest of the fields are getting populated
    • But during the save process, everything gets saved except for FIELD A (the value reverts to the old value or if its a new record it just gets saved as blank)


    Any directions will be much appreciated.

    Thanks,

    Cedric
    Last edited by cedcas; 2011-02-21 at 03:28 PM. Reason: more clarifications

  2. #2
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Retrieving Data from other Module through Relate Field

    'name' => 'field_a',

    are you sure this is ok? Did you try

    'field_a' => 'name' // or some other field
    CRM Software Engineer
    Eontek - www.eontek.rs

  3. #3
    cedcas is offline Member
    Join Date
    Sep 2009
    Posts
    18

    Default Re: Retrieving Data from other Module through Relate Field

    Hello Eitrix,

    Yes, that is the correct field name. Actually, without the displayParams array (and down), the RELATE field works perfectly. I did try to play around with the fields in terms of changing them around but no cigar. I think the issue lies somewhere in passing values through variables and somehow it doesn't get to the SQL update at all.

    Cedric

  4. #4
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Retrieving Data from other Module through Relate Field

    if this is relate field, did you forget to fill up the id that comes with relate field ?
    CRM Software Engineer
    Eontek - www.eontek.rs

  5. #5
    cedcas is offline Member
    Join Date
    Sep 2009
    Posts
    18

    Default Re: Retrieving Data from other Module through Relate Field

    Thanks Eitrix,

    That was actually the solution, which was:

    Code:
              array (
                'name' => 'field_a',
                  'studio' => 'visible',
                  'label' => 'LBL_FIELD_A',
                  'validateDependency'=>false,         
                'displayParams' => 
                   array (
                  'field_to_name_array' => 
                      array (
                       'id' => 'field_a_id_c',
                       'from_field_b' => 'field_b',
                       'from_field_c' => 'field_c',
                       'from_field_d' => 'field_d',
                       'from_field_e' => 'field_e',
                       'from_field_f' => 'field_f',
                       'from_field_g' => 'field_g',
                            ),
                         ),
                    ),
    Thanks again!

  6. #6
    kshaw661 is offline Member
    Join Date
    Jan 2011
    Location
    India
    Posts
    19

    Default Re: Retrieving Data from other Module through Relate Field

    When i am fetch the data from relate module then some values are come and some are not.
    I cant understand why please help me.
    my code is
    array (
    'name' => 'reporting_to_manager_c',
    'studio' => 'visible',
    'label' => 'LBL_REPORTING_TO_MANAGER',
    'displayParams' =>
    array (
    'field_to_name_array' =>
    array (
    'id' => 'a1234_managers_id_c',
    'name' => 'reporting_to_manager_c',
    'designation_c' => 'manager_des_c',
    'phone_mobile' => 'mobileno_c',
    'manager_code_c' => 'managercode_c',
    'alt_number_c' => 'alt_no_c',
    ),
    ),

    Here the designation_c and
    alt_number_c is not comming
    why
    plese help me
    as soon as possible
    Thank you
    Kunal

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Relate field : how to retrieve other module data ?
    By anokirda in forum Developer Help
    Replies: 5
    Last Post: 2011-02-12, 02:45 AM
  2. custom field with data type: relate
    By 1joe in forum Developer Help
    Replies: 0
    Last Post: 2010-04-16, 01:59 AM
  3. Importing data into a Flex-Relate field.
    By jleaman in forum Developer Help
    Replies: 1
    Last Post: 2009-10-03, 03:04 PM
  4. Display Relate Field Data in the Subpanel of module
    By Avi.Nale in forum Developer Help
    Replies: 2
    Last Post: 2009-05-06, 05:50 AM
  5. Replies: 3
    Last Post: 2008-06-11, 10:13 AM

Tags for this Thread

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
  •