Results 1 to 3 of 3

Thread: Problem with Relationship and/or table access on custom field

  1. #1
    jobst's Avatar
    jobst is offline Sugar Community Member
    Join Date
    Sep 2005
    Location
    Melbourne
    Posts
    55

    Default Problem with Relationship and/or table access on custom field

    Hi.

    It's been a long time I I have been working on SugarCRM modules, so I am a bit rusty.
    I am trying to update one of my old modules (calendar notes) but in the same time changing some of the structure and use later features available to developers.

    When I install the module (thru module installer) all is fine and I can use everything, everything is saved correctly etc.

    Once I installed another module or did a repair (using rebuilt relation ships) I loose access to fields that I placed into users_cstm (I store config info related to the notes/calendar per user).

    I can access the config (each user can do this) through clicking on the user (welcome USERID), than on the users tab "Calendar Notes", than "Edit". All shows up correctly but when I hit save it does not get saved.

    I can see it being save in the sugar log e.g.:
    Fri 27 Jan 2012 12:51:38 EST [26660][1][INFO] Query:UPDATE users_cstm SET calnote_room='green' ......

    The field is STILL visible in the users_cstm table, but when I hit save and check what shows up in the SUGAR log it does not show up, so it is lost (relation ship lost).

    I have placed the field into the manifest.php (probably the problem):

    'calnote_room' => array (
    'id' => 'users_calnote_room',
    'name' => 'calnote_room',
    'label' => 'LBL_calnote_room',
    'module' => 'Users',
    'type' => 'varchar',
    'require_option' => '0',
    'default_value' => '',
    'deleted' => '0',
    'duplicate_merge' => '1',
    'reportable' => '1',
    ),

    So what am I doing wrong?
    Do I have to place this into the vardefs.php file in the Users dir of the modules zip?

    JObst
    I code, therefore I 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: Problem with Relationship and/or table access on custom field

    Quote Originally Posted by jobst View Post
    I can see it being save in the sugar log e.g.:
    Fri 27 Jan 2012 12:51:38 EST [26660][1][INFO] Query:UPDATE users_cstm SET calnote_room='green' ......
    I am not sure I follow, are you saying that you are trying to change this value and in the log you see the above SQL but the value isnt being changed?
    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
    jobst's Avatar
    jobst is offline Sugar Community Member
    Join Date
    Sep 2005
    Location
    Melbourne
    Posts
    55

    Default Re: Problem with Relationship and/or table access on custom field

    Quote Originally Posted by kbrill View Post
    I am not sure I follow, are you saying that you are trying to change this value and in the log you see the above SQL but the value isnt being changed?
    OK, I am very rusty ... I cannot even remember all the terms :-(, sorry!!

    My problem happens only AFTER I installed another module or I did repair relationship, when I freshly install this/my module all is fine ... I can change the values and I can see the correct changes in the database, this is important ... so I must have forgotten something in the vardefs/relationship stuff.

    Under the Users TAB I have a link to change/view/edit the config stuff per user for my module which is saved in the users_cstm table (I can see the values).
    When I click the "Config CalendarNote" button, the display view opens, all the fields are there, but incorrect values.
    When I then press the EDIT button the edit view is opened with all the fields, but incorrect values (again).
    When I then press the save button it goes back to the detail view but the changes I made do not appear and neither do the changes appear in the database and I cannot see the SQL statement coming up in the sugarcrm log.

    If I have freshly installed the module and make changes, the values appear in the database, the values appear in the detail view after the save and I can see the SQL query being executed in the sugarcrm log.

    So from my memory this indicates that I have not included the correct relationship or did not instruct sugarcrm in a way that after a "repair relationship" or "install of another module" the link is made correctly between my module and the Users entries ... but I cannot pinpoint what I have forgotten.

    jobst
    I code, therefore I am!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. audit a field in a relationship table
    By Ramblin in forum Developer Help
    Replies: 23
    Last Post: 2012-02-09, 02:58 PM
  2. audit a field in a relationship table
    By Ramblin in forum Developer Help
    Replies: 0
    Last Post: 2012-01-19, 08:49 AM
  3. audit field in relationship table
    By Ramblin in forum Help
    Replies: 1
    Last Post: 2011-12-24, 11:15 AM
  4. Custom Table Relationship Problem
    By LX Dog in forum Developer Help
    Replies: 2
    Last Post: 2011-02-22, 02:14 AM
  5. Display custom field in relationship table
    By sugaradmin in forum Developer Help
    Replies: 4
    Last Post: 2008-07-29, 01:30 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
  •