Results 1 to 2 of 2

Thread: Access to account_id in before_save event when creating a contact

  1. #1
    Phil Norman is offline Junior Member
    Join Date
    Aug 2011
    Posts
    1

    Default Access to account_id in before_save event when creating a contact

    Does anyone know how to access the account id for a contact in the before save hook?
    When I save details of a contact for whom I have assigned an account the value is stored in $bean->account_id when modifying an existing contact, but not when creating a new one.
    I am using version 5.4.4 of SugarCRM.
    Does anyone know if this works for newer versions of SugarCRM?

  2. #2
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    2,224

    Default Re: Access to account_id in before_save event when creating a contact

    Quote Originally Posted by Phil Norman View Post
    Does anyone know how to access the account id for a contact in the before save hook?
    When I save details of a contact for whom I have assigned an account the value is stored in $bean->account_id when modifying an existing contact, but not when creating a new one.
    I am using version 5.4.4 of SugarCRM.
    Does anyone know if this works for newer versions of SugarCRM?
    You should be able to access the bean's id in the $bean->id attribute.
    John Mertic
    Sugar Community Manager

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Creating Paid Access & Contact Thresholds
    By katemerart in forum Developer Help
    Replies: 1
    Last Post: 2011-06-26, 12:24 AM
  2. Creating Contact Whilst Creating New Account
    By pifoot in forum General Discussion
    Replies: 2
    Last Post: 2009-07-03, 08:44 PM
  3. Replies: 4
    Last Post: 2009-04-06, 11:45 AM
  4. Replies: 0
    Last Post: 2009-01-23, 01:53 AM
  5. Replies: 0
    Last Post: 2008-09-05, 12:35 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
  •