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

Thread: Lbl_date_modified:

  1. #1
    stilwell is offline Member
    Join Date
    Nov 2009
    Posts
    6

    Default Lbl_date_modified:

    hello,
    i would like the modified date/time to change when anything inside a case is touched. is this possible? for instance the LBL_DATE_MODIFIED only gets modified when you actually edit the case not when you ad a note or attachment.

    any help would be appreciated.

    thanks

  2. #2
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Lbl_date_modified:

    The case is actually not modified when a note is added that is why the date_modified is not changed.

    You could create a before_save logic hook on Notes that update the date_modified on the related bean (case).
    If you are new to logic hooks use the tool in my signature to create an after_save logic hook on Notes and put something like this inside it.

    PHP Code:
    if ($bean->parent_type == 'Cases')
    {
        require_once 
    "modules/Cases/Case.php";
        
    $case = new aCase();
        
    $case->retrieve($bean->parent_id);
        
    $case->date_modified $bean->date_modified;  // set case date same as the note
        
    $case->modified_user_id $bean->modified_user_id;
        
    $case->save();

    M
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  3. #3
    stilwell is offline Member
    Join Date
    Nov 2009
    Posts
    6

    Default Re: Lbl_date_modified:

    thanks but i tried installing your module and all i get are broken links when i go to the admin page.

  4. #4
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Default Re: Lbl_date_modified:

    Do you know how to write logic hooks, if so I can send you a tutorial to solve this

    regards

    John

  5. #5
    stilwell is offline Member
    Join Date
    Nov 2009
    Posts
    6

    Default Re: Lbl_date_modified:

    Quote Originally Posted by routledge View Post
    Do you know how to write logic hooks, if so I can send you a tutorial to solve this

    regards

    John
    negative... if you could send it that would be great.

  6. #6
    stilwell is offline Member
    Join Date
    Nov 2009
    Posts
    6

    Default Re: Lbl_date_modified:

    Quote Originally Posted by stilwell View Post
    thanks but i tried installing your module and all i get are broken links when i go to the admin page.
    i installed the previous version and it worked... let me try it out.

    put that code in and get this now when i click on a case

    if ($bean->parent_type == 'Cases') { require_once "modules/Cases/Case.php"; $case = new aCase(); $case->retrieve($bean->parent_id); $case->date_modified = $bean->date_modified; // set case date same as the note $case->modified_user_id = $bean->modified_user_id; $case->save(); }
    Fatal error: Class 'Test_class' not found in D:\Domains\stilwell-associates.com\wwwroot\CRM\include\utils\LogicHook .php on line 123

  7. #7
    stilwell is offline Member
    Join Date
    Nov 2009
    Posts
    6

    Default Re: Lbl_date_modified:

    i really need help... now i cant look at any cases because this logic hook code is messed up. i tried uninstalling the module but that didnt help.

  8. #8
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Default Re: Lbl_date_modified:

    Have a look at the attached pdf's change accounts to cases and cases to notes and this will get you on your way.

    Any other queries just yell

    Regards

    John
    Attached Images Attached Images

  9. #9
    routledge is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    London
    Posts
    98

    Default Re: Lbl_date_modified:

    comment out the line pointing to your function in logic_hooks.php this should turn off the hook

    i.e <root>/custom/modules/<module>/logic_hooks.php
    Last edited by routledge; 2009-11-06 at 03:47 PM.

  10. #10
    stilwell is offline Member
    Join Date
    Nov 2009
    Posts
    6

    Default Re: Lbl_date_modified:

    Quote Originally Posted by routledge View Post
    comment out the line pointing to your function in logic_hooks.php this should turn off the hook

    i.e <root>/custom/modules/<module>/logic_hooks.php
    thanks!!

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)

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
  •