Results 1 to 6 of 6

Thread: Locking record while editing by another user in 5.0 CE

  1. #1
    TommyL is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    30

    Default Locking record while editing by another user in 5.0 CE

    Hi everybody,

    is there an implementation in sugar 5.0.X for locking records while editing by another user?

    for example:

    User ‘A’ queries a Contact in EditView.
    User ‘B’ queries the the same Contact in EditView.

    Sugar have to forbid User B to open the record in EditView and alterts a message like "no access, user a is editing the record".

    Is this function implements? Maybe by setting roles?

    Thanks for your answers,

    Greets, TommyL

  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: Locking record while editing by another user in 5.0 CE

    Hi TommyL

    Some modules vardef.php has the attribute 'optimistic_locking' which when set to 'true' should lock the record while been edited by someone else.

    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
    TommyL is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    30

    Default Re: Locking record while editing by another user in 5.0 CE

    Thanks andopes, I notice the function for example in Notes module.

    I need the implementaion for my custom modules, i set the attribute 'optimistic_locking' to true following by rebuild, but it doesn't working in my custom modules.

    I build the modules by module builder and by standard the attribute 'optimistic_lock'=>true (not lockING) is included, is this something different?

    Any further idea? Thanks.
    Last edited by TommyL; 2008-09-29 at 09:25 PM.

  4. #4
    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: Locking record while editing by another user in 5.0 CE

    Hi TommyL

    Go to Admin -> Repair -> Rebuild Extension

    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.

  5. #5
    TommyL is offline Sugar Community Member
    Join Date
    Apr 2008
    Posts
    30

    Default Re: Locking record while editing by another user in 5.0 CE

    If there is another save method in the customBean->save() (for second module) the locking didn't work:

    Overwriting the save method in Custom Module 1 like this:

    Code:
    	
    function save($check_notify = FALSE){
      $obj = new customModule2;
      $obj->var = "fill me";
      $obj->save();
      return parent::save($check_notify);
    }
    Then locking doesn't work. Inputs of User B overwrite the changes of User A.

    When I replace $obj->save(); Locking is working.

    Maybe I have to develop my own locking method, anybody know where the information are saved when more then one users are accessing the same record?

    Is there a workaround? Thanks a lot.

    Cheers, TommyL
    Last edited by TommyL; 2008-09-29 at 10:37 PM.

  6. #6
    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: Locking record while editing by another user in 5.0 CE

    Hi TommyL

    According to documentation the optimistic lock works for editing records from EditView, so if you edit a record from another module the optimistic should not work.

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. record locking and module visibility
    By dricrm in forum Developer Help
    Replies: 1
    Last Post: 2008-07-07, 11:59 AM
  2. Replies: 0
    Last Post: 2006-06-23, 09:55 PM
  3. Policy on Record Locking?
    By epic in forum General Discussion
    Replies: 4
    Last Post: 2005-07-14, 10:38 PM
  4. Policy on Record Locking
    By epic in forum Developer Help
    Replies: 0
    Last Post: 2005-07-07, 12:02 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
  •