Results 1 to 8 of 8

Thread: Mapping to Relate field on import to custom module

  1. #1
    jm_phila is offline Sugar Community Member
    Join Date
    May 2011
    Location
    Philadelphia, PA, USA
    Posts
    70

    Default Mapping to Relate field on import to custom module

    I have a custom module based on the Accounts module. I am using the importer to pull in data to the module, and I only need to map two fields: a TextField, and a Relate field tied to the Accounts module. I have records in the Accounts module. When I run the import, the text values are pulled in but the relate field is not populating. How can I resolve this?

    Using CE 6.2.3

  2. #2
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: Mapping to Relate field on import to custom module

    I am having the same issue with this. Trying to import a csv file into a custom module but all 'Relate' fields do not appear to accept any data.

    At first I thought it might have something to do with me deleting the automatically created 'id' field (e.g. It seems to create a id field that relates to the module/table I am linking to), but I went through the process again by re-creating the custom fields and this time I kept those auto-files. Still no joy.

    Anyway, if someone can suss out how to import data into relate fields it would be greatly appreciated

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

    Default Re: Mapping to Relate field on import to custom module

    The relate field is a dinosaur from the past, it was added back before we added the ability to create custom relationships, and I always recommend against using it for anything.

    Replace it with a one-to-many relationship (add the relationship to the module that you want to have the field on the Editview, your custom module in this case I would think) and you will be able to import to that field and it will look and act the same way for your users.

    If you have data already in this relate field then you will lose it of course. Its not impossible to move it over but it would require someone familiar with SQL to do it.
    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

  4. #4
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: Mapping to Relate field on import to custom module

    Hello KBrill and thanks for your swift reply.

    Adding a relationship between my custom module and another module doesn't seem to do anything other than show subpanels, if configured in a certain way. I have created a one>many relationship by going to Module Builder>>MyModule>>Relationships. I then create a new relationship (one-to-many) and then run a rebuild relationships from the Admin/Repair section, but this doesn't seem to do anything.

    After deploying the custom module I went to Studio>>MyCustomModule>>Fields but I am unsure which field type to use? I am guessing I probably don't fully understand the power of the relationships?

    The relate field seemed to work well as when creating a record in my new module it would enable me to select records from other modules, without any relationships.

    Sorry I am not great at explaining this but hopefully you can help further

    Hope some of this makes sense...

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

    Default Re: Mapping to Relate field on import to custom module

    Quote Originally Posted by whitewidow View Post
    Hello KBrill and thanks for your swift reply.

    Adding a relationship between my custom module and another module doesn't seem to do anything other than show subpanels, if configured in a certain way. I have created a one>many relationship by going to Module Builder>>MyModule>>Relationships. I then create a new relationship (one-to-many) and then run a rebuild relationships from the Admin/Repair section, but this doesn't seem to do anything.
    then something is wrong with your servers permissions. If you set up a 'one-to-many' relationship what should happen is that a field is added to your edit/detail views in the module that you added the relationship to and a subpanel should be added to the related module.
    Quote Originally Posted by whitewidow View Post
    After deploying the custom module I went to Studio>>MyCustomModule>>Fields but I am unsure which field type to use? I am guessing I probably don't fully understand the power of the relationships?
    You do not add any fields, the relationship adds the field for you. At least it does here.
    Quote Originally Posted by whitewidow View Post
    The relate field seemed to work well as when creating a record in my new module it would enable me to select records from other modules, without any relationships.

    Sorry I am not great at explaining this but hopefully you can help further

    Hope some of this makes sense...
    Yes, but it has no import functionality (that I know of at least) and it doesnt work in Reports in Pro/Ent (I know, not a concern in this case).

    I would look at your logs and see why adding a relationship seems to have failed in your case. A relationship is the way to go to fix your import issue.
    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

  6. #6
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Default Re: Mapping to Relate field on import to custom module

    Quote Originally Posted by kbrill View Post
    then something is wrong with your servers permissions. If you set up a 'one-to-many' relationship what should happen is that a field is added to your edit/detail views in the module that you added the relationship to and a subpanel should be added to the related module.
    Hmm that's odd then. The subpanel appears against each record yet I am unable to add any additional fields from that related module into my edit/detail/list views in the studio area.

    Useful info:

    Sugar CRM V: 6.2.0 (build 6354) CE Edition
    Xampp Control Panel Version 2.5

    From PhpMyAdmin:

    Server: localhost via TCP/IP
    Server version: 5.1.33-community
    Protocol version: 10
    User: root@localhost
    MySQL charset: UTF-8 Unicode (utf8)
    Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
    MySQL client version: 5.0.51a
    PHP extension: mysql

    And as far as I know there are no "Server Restrictions" in-place that I know of as it's a local server test system with user: root and blank admin password.

    Another thing I have noticed is some of the blurb in the relationship section that says: Relationships can be created between the module and another deployed module. Relationships are visually expressed through subpanels and relate fields in the module records.
    Select one of the following relationship Types for the module:

    One-to-One - Both modules' records will contain relate fields.
    One-to-Many - The Primary Module's record will contain a subpanel (YES, this happens, all good so far), and the Related Module's record will contain a relate field (NO - Cannot see this anywhere).

    Am I correct in thinking that after setting up this relationship, new fields should appear in the "fields" section and that new "drag&drop" boxes of all the related modules fields appear for selection? I think this is maybe where I am going wrong or missing something vital.

    Thanks again for your help it's greatly appreciated

  7. #7
    whitewidow is offline Sugar Community Member
    Join Date
    Jun 2010
    Posts
    68

    Smile Re: Mapping to Relate field on import to custom module

    OK I think I have got it sorted now. Seems like it had something to do with previously created modules and relationships, and I was being a bit short-sighted...

    I now know how this works properly and am in the process of testing it. Need to make sure it works for import.
    Thanks for your help on this too kbrill

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

    Default Re: Mapping to Relate field on import to custom module

    Good to hear it, let us know how it works out.
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HELP - Act import (field mapping)
    By smelamed in forum Help
    Replies: 32
    Last Post: 2010-12-15, 05:39 PM
  2. Replies: 3
    Last Post: 2010-04-08, 03:14 AM
  3. Replies: 0
    Last Post: 2009-11-19, 07:06 PM
  4. Import to custom relate field on Leads
    By tomatosld in forum Help
    Replies: 0
    Last Post: 2008-08-01, 05:57 PM
  5. Custom Field Import Mapping
    By acherwinski in forum Help
    Replies: 0
    Last Post: 2007-11-13, 12:03 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
  •