Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Problem saving data from custom fields

  1. #1
    saclaudio is offline Junior Member
    Join Date
    Aug 2008
    Posts
    1

    Default Problem saving data from custom fields

    Hi,

    I had created 6 customs fields in the ACCOUNT module. 5 fields are DROPDOWN and 1 field is DECIMAL.
    The EDIT layout from ACCOUNT was changed with the insertion of the new customs fields.
    In the ACCOUNT EDIT panel I have CUSTOMS and DEFAULT fields. When I make any change or crate a new account, only the DEFAULTS fields are changed. Then customs fields taht I create are not altered or remaing unchanged.

    Can anybody help me?

    Thanks,
    Claudio

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Problem saving data from custom fields

    Hi Claudio

    If you have access to the database and source code do the following:
    1. Check if there are records into fields_meta_data table related to these fields;
    2. Check if the fields had been created into accounts_cstm table;
    3. Check if the fields had been added to the cache/modules/Accounts/Accountvardefs.php file
    4. Debug the function save in the script modules/DynamicFields/DynamicField.php, print the sql for inserting or updating in the databse.

    Attach in your next post the content of the file cache/modules/Accounts/Accountvardefs.php.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    henkel is offline Junior Member
    Join Date
    Apr 2008
    Location
    Germany
    Posts
    2

    Post Re: Problem saving data from custom fields

    Hello there!
    It seems I have nearly or exactly the same problem as saclaudio.
    For my accounts module I created some dropdowns,textfields and then a decimal field for annual revenue and an integer field with len=4 in order to save the year for the revenue. I placed the fields onto edit and detail view, then used Admin->Repair and made sure fields are shown and usable. When I filled in some testdata the fun began nothing was saved!
    Following andopes´ instructions i had a look at the MySQL Database via phpMyAdmin.

    Quote Originally Posted by andopes
    If you have access to the database and source code do the following:
    1. Check if there are records into fields_meta_data table related to these fields;
    2. Check if the fields had been created into accounts_cstm table;
    3. Check if the fields had been added to the cache/modules/Accounts/Accountvardefs.php file
    4. Debug the function save in the script modules/DynamicFields/DynamicField.php, print the sql for inserting or updating in the databse.
    Attach in your next post the content of the file cache/modules/Accounts/Accountvardefs.php.
    Cheers
    1 > records for all fields can be found in fields_meta_data
    2 > the intger and decimals fields have NOT been created in the accounts_cstm
    3 > all fields had been added to the cache/modules/Accounts/Accountvardefs.php file
    4 > sorry, i don´t fully understand what you mean by this

    Here is a section of the accountsvardef.php containing the definition for an integer field
    Code:
    'umjah_c' =>      array ( 
    'required' => '0',   
    'source' => 'custom_fields',       
    'name' => 'umjah_c',
    'vname' => 'LBL_UMJAH',       
    'type' => 'int',       
    'massupdate' => '0',       
    'default' => NULL,       
    'comments' => '',       
    'help' => '',       
    'duplicate_merge' => 'disabled',       
    'duplicate_merge_dom_value' => '0',       
    'audited' => 0,       
    'reportable' => 0,       
    'len' => '4',       
    'disable_num_format' => '1',       
    'id' => 'Accountsumjah_c',       
    'custom_module' => 'Accounts',       
    'default_value' => NULL,     
    ),
    Can someone help me with this problem?
    Thanks in advance for your efforts!

  4. #4
    bent is offline Senior Member
    Join Date
    Sep 2008
    Posts
    29

    Default Re: Problem saving data from custom fields

    Quote Originally Posted by andopes
    If you have access to the database and source code do the following:
    1. Check if there are records into fields_meta_data table related to these fields;
    2. Check if the fields had been created into accounts_cstm table;
    3. Check if the fields had been added to the cache/modules/Accounts/Accountvardefs.php file
    4. Debug the function save in the script modules/DynamicFields/DynamicField.php, print the sql for inserting or updating in the databse.
    Attach in your next post the content of the file cache/modules/Accounts/Accountvardefs.php.
    Cheers
    I have exactly the same problem, only with custom fields in the contact module. As henkel I verified that

    - records for all fields can be found in fields_meta_data
    - the intger and decimals fields have NOT been created in the contacts_cstm
    - all fields had been added to the cache/modules/Contacts/contactsvardefs.php file


    Also I noted that:
    - converting from the lead module will create the (not modifiable however) custom data values in the contact module,
    - custom data from records created a long time ago are even modifiable,


    So may it be that there is some bug the Studio that somehow hinders the newly created data sets to be modified via the edit view?

  5. #5
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Problem saving data from custom fields

    Hi all

    Claudio
    The zip file you attached didn't help me properly.
    You could send me an answer just like henkel and bent.

    henkel and bent, let me know the fields which had not been created.

    Best regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  6. #6
    bent is offline Senior Member
    Join Date
    Sep 2008
    Posts
    29

    Default Re: Problem saving data from custom fields

    Hallo André - thanks for giving input on this. To clarify the issue maybe

    FIELDS
    - all fields are created and are shown on detail and custom views
    - the data fields that I have added and that do not work are "letter_salutation_c", "sex_c", "program_role_c"

    DATA
    - input and update of all default fields works perfect for all data sets
    - input and update of all custom fields only work for older data sets
    - input and update of custom fields once did work smoothly for months


    LEAD->CONTACT CONVERSION
    - works perfect - also for the data of the mentioned custom fields, however
    - they cannot be saved after edit in the contacts-edit view afterwards

    So I assume that some faulty code resulting from an studio export has done it to the custom module and somehow blocks the modification of the custom fields for all newly created data sets...

    I just do not know where I can look for a solution...

  7. #7
    henkel is offline Junior Member
    Join Date
    Apr 2008
    Location
    Germany
    Posts
    2

    Default Re: Problem saving data from custom fields

    Quote Originally Posted by andopes
    henkel and bent, let me know the fields which had not been created.
    Thanks so far for your help andopes, i really appreciate it.

    Following are the definitions for the fields from accountsvardefs.php. I created these fields in studio and entries in accountsvardefs.php were created by Sugar.
    The fields are:
    - jmzah_c > a field contaning the number of employees
    - jmjah_c > the year in which the mentioned employees were employed
    - umsa_c > a field for annual revenue
    - umjah_c > the year of the mentioned annual revenue
    In Detail/ Edit View it looks like this:
    Employees: xxxxxx in year: 2007
    Annual Revenue: xxxxxxx.yy in year: 2007

    @andopes: I hope this is the information you asked for : )

    Code:
    'jmzah_c' => 
        array (
          'required' => '0',
          'source' => 'custom_fields',
          'name' => 'jmzah_c',
          'vname' => 'LBL_JMZAH',
          'type' => 'int',
          'massupdate' => '0',
          'default' => NULL,
          'comments' => '',
          'help' => '',
          'duplicate_merge' => 'disabled',
          'duplicate_merge_dom_value' => '0',
          'audited' => 0,
          'reportable' => 0,
          'len' => '6',
          'disable_num_format' => NULL,
          'id' => 'Accountsjmzah_c',
          'custom_module' => 'Accounts',
          'default_value' => NULL,
        ),
    
    'jmjah_c' => 
        array (
          'required' => '0',
          'source' => 'custom_fields',
          'name' => 'jmjah_c',
          'vname' => 'LBL_JMJAH',
          'type' => 'int',
          'massupdate' => '0',
          'default' => NULL,
          'comments' => '',
          'help' => '',
          'duplicate_merge' => 'disabled',
          'duplicate_merge_dom_value' => '0',
          'audited' => 0,
          'reportable' => 0,
          'len' => '4',
          'disable_num_format' => '1',
          'id' => 'Accountsjmjah_c',
          'custom_module' => 'Accounts',
          'default_value' => NULL,
        ),
    
    'umsa1_c' => // 15 digits in total of which 2 are meant to be decimal digits
        array (
          'required' => '0',
          'source' => 'custom_fields',
          'name' => 'umsa1_c',
          'vname' => 'LBL_UMSA1',
          'type' => 'decimal',
          'massupdate' => '0',
          'default' => NULL,
          'comments' => '',
          'help' => '',
          'duplicate_merge' => 'disabled',
          'duplicate_merge_dom_value' => '0',
          'audited' => 0,
          'reportable' => 0,
          'len' => '16',
          'id' => 'Accountsumsa1_c',
          'custom_module' => 'Accounts',
          'default_value' => NULL,
        ),
    
    'umjah_c' => 
        array (
          'required' => '0',
          'source' => 'custom_fields',
          'name' => 'umjah_c',
          'vname' => 'LBL_UMJAH',
          'type' => 'int',
          'massupdate' => '0',
          'default' => NULL,
          'comments' => '',
          'help' => '',
          'duplicate_merge' => 'disabled',
          'duplicate_merge_dom_value' => '0',
          'audited' => 0,
          'reportable' => 0,
          'len' => '4',
          'disable_num_format' => '1',
          'id' => 'Accountsumjah_c',
          'custom_module' => 'Accounts',
          'default_value' => NULL,
        ),

  8. #8
    Markus85 is offline Junior Member
    Join Date
    Sep 2008
    Posts
    1

    Default Re: Problem saving data from custom fields

    Hello People,

    I'm facing a problem with my contact person input,
    When I'm creating a new contact person all the custom fields appear and can be filled in, but when i'm saving all the data, just a few inputs are saved. Does anyone know what my problem can be?

    thanks!

    Grts

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

    Default Re: Problem saving data from custom fields

    It is a very simple issue.
    If you create a new custom field of data type Decimal or Integer and if you do not set a Default value, a statement like that.

    ALTER TABLE bugs_cstm ADD indicator_c FLOAT(18,2) DEFAULT ''

    is used to add your custom field in the database.
    THAT DOES NOT WORK!

    If you set the Default value to a numeric value like 0 the statement will be:

    ALTER TABLE bugs_cstm ADD indicator_c FLOAT(18,2) DEFAULT '0'
    THIS WORKS.

    I found the bug in 4.5.1 and 5.0.0, 5.1 I did not test yet.
    Last edited by kuske; 2008-09-09 at 03:12 PM.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  10. #10
    soedesve is offline Junior Member
    Join Date
    Jun 2008
    Posts
    3

    Default Re: Problem saving data from custom fields

    Quote Originally Posted by kuske
    It is a very simple issue.
    If you create a new custom field of data type Decimal or Integer and if you do not set a Default value, a statement like that.

    ALTER TABLE bugs_cstm ADD indicator_c FLOAT(18,2) DEFAULT ''

    is used to add your custom field in the database.
    THAT DOES NOT WORK!
    exactly that´s the problem ...

    Quote Originally Posted by kuske
    If you set the Default value to a numeric value like 0 the statement will be:
    exactly that´s the solution ...

    Quote Originally Posted by kuske
    I found the bug in 4.5.1 and 5.0.0, 5.1 I did not test yet.
    in 5.0.0g it still exists ...
    I posted this Case and they created bug# 24141 on 2008-08-26, Targeted Release: 5.0.0h (I didn´t test it)

Page 1 of 2 12 LastLast

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. Custom Fields not saving input data
    By mickster in forum Help
    Replies: 3
    Last Post: 2007-03-08, 01:50 PM
  3. Custom employee fields not saving
    By michaeloder in forum Help
    Replies: 3
    Last Post: 2006-09-24, 09:21 AM
  4. Replies: 0
    Last Post: 2005-07-25, 04:47 AM

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
  •