Results 1 to 6 of 6

Thread: Editing a module with custom fields creates a duplicate record in the "_cstm" table

  1. #1
    bretweinraub is offline Member
    Join Date
    Aug 2007
    Posts
    7

    Question Editing a module with custom fields creates a duplicate record in the "_cstm" table

    OS: Redhat EL 4
    Sugar Version : 4.5.1d (bundle)

    We have a strange problem involving duplicate records.

    For our opportunities module, we have added a single custom column.

    Now when editing an opportunity record, a duplicate record in the "_cstm" table is created. This
    causes duplicates to appear in the list view.

    Many things have been checked and sugar repair buttons clicked, all to no avail. It seems some meta-data
    must be out of date somewhere. Fields_meta-data has been checked and looks valid.

    Any hints or suggestions appreciated.
    Last edited by bretweinraub; 2007-11-07 at 05:27 PM. Reason: typo

  2. #2
    bretweinraub is offline Member
    Join Date
    Aug 2007
    Posts
    7

    Cool Re: Editing a module with custom fields creates a duplicate record in the "_cstm" tab

    A little more information.

    If I open the opportunity and edit the custom column, no duplicate _cstm record is created. All the existing _cstm records (with the matching 'id') are updated in this case.

    Its only when editing a non-custom column that the duplicate is created.

    I'm assuming the logic of this is in SugarBean.php .....

  3. #3
    bretweinraub is offline Member
    Join Date
    Aug 2007
    Posts
    7

    Default Re: Editing a module with custom fields creates a duplicate record in the "_cstm" tab

    For no apparent reason I can resolve this problem by

    - droping the columns from *_cstm
    - deleting the entries from fields_meta_data
    - re-adding the rows to *_cstm
    - re-adding the rows to fields_meta_data
    - deleting the cache/dynamic_fields/*/fields.php file

    things that make ya go hmmmmmmm

  4. #4
    ffeog is offline Junior Member
    Join Date
    Aug 2007
    Posts
    1

    Unhappy Re: Editing a module with custom fields creates a duplicate record in the "_cstm" tab

    I haven't tried bret's solution yet, but I'm having a duplicate records problem - so far in calls and emails and seemingly related to when a lead is promoted to a contact or account added, the related email/call is duplicated/triplicated in the list view. I post this here because I'm also using a custom field so this might be the cause of it, but it certainly looks like a bug to me. I'm using Sugar OS 4.5.1g

  5. #5
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Editing a module with custom fields creates a duplicate record in the "_cstm" tab

    Please give more details, this custom field, how did you define it excatly?
    Perhaps it happens only for such fields.

    hk

  6. #6
    bretweinraub is offline Member
    Join Date
    Aug 2007
    Posts
    7

    Default Re: Editing a module with custom fields creates a duplicate record in the "_cstm" tab

    Quote Originally Posted by ffeog
    I haven't tried bret's solution yet, but I'm having a duplicate records problem - so far in calls and emails and seemingly related to when a lead is promoted to a contact or account added, the related email/call is duplicated/triplicated in the list view. I post this here because I'm also using a custom field so this might be the cause of it, but it certainly looks like a bug to me. I'm using Sugar OS 4.5.1g
    What database type/version are you using? One of my subcontractors has hit this in the mean time and they believe they've developed a bug fix in

    if((($this->db->dbType=='mysql' || $this->db->dbType=='mssql') && $this->db->getAffectedRowCount($result) == 0) || (($this->db->dbType=='oci8' ) && $this->db->getRowCount($result) == 0) ){
    echo'ttt';
    $this->db->query($queryInsert);
    }

    from

    modules/DynamicField/DynamicField.php

    Looks like mysql was always showing getAffectedRowCount as 0 - and was thus creating duplicate records.

    I'll post some more about this if I get a little more info

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Saving and updating custom fields data
    By jones70 in forum Developer Help
    Replies: 2
    Last Post: 2011-10-05, 06:10 AM
  2. Module Builder
    By Olavo in forum Downloads
    Replies: 418
    Last Post: 2009-02-26, 06:36 AM
  3. Replies: 1
    Last Post: 2007-09-16, 01:06 AM
  4. Replies: 5
    Last Post: 2006-06-01, 02:18 PM
  5. Replies: 4
    Last Post: 2005-09-12, 03:53 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
  •