Results 1 to 3 of 3

Thread: What am i doing wring mysql

  1. #1
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default Info@hand workflow errors - Pleeeeeeeze help

    We are using Info @ hand and the workflow has a bug.

    If you do a workflow in case to create a task, it creates over 500 tasks. thus the reason i am trying this script.

    What i am trying to achieve is when case status equels -- to create a task calledd --. but in this script it keeps creating the tasks everytime i edit a case and the status stays the same, or even when i edit the task a new task gets created.
    How would i be able to fix this, or does someone know how to fix the info@hand workflow from multiplying.

    DELIMITER $$

    USE `======`$$

    DROP TRIGGER /*!50032 IF EXISTS */ `Cases`$$

    CREATE
    /*!50017 DEFINER = 'eeeeee'@'localhost' */
    TRIGGER `Cases` AFTER UPDATE ON `cases`
    FOR EACH ROW BEGIN
    INSERT INTO tasks (id,date_entered,date_modified,assigned_user_id,mo dified_user_id,created_by,
    NAME,STATUS,date_due_flag,date_start_flag,parent_t ype,parent_id,priority,description)

    SELECT MD5(RAND()) AS id,
    CURDATE()AS 'd1',

    CURDATE() AS 'D2',

    assigned_user_id,

    modified_user_id,

    created_by,

    CASE

    WHEN STATUS = 'Obtain Info' THEN 'Gather Info'
    WHEN STATUS = 'Contact Client' THEN 'Contact Client to get more info'
    END AS 'taskname',
    'Not Started' AS 'caseSTATUS',
    'on' AS 'on121',
    'on' AS 'on1',
    'Cases' AS 'beantype',
    cases.id AS 'Caseid',
    'p2' AS 'peep',
    CASE
    WHEN STATUS = 'Obtain Info' THEN 'Gather all relevant information need to assist the SP'
    WHEN STATUS = 'Contact Client' THEN 'Contact Client to get more info'
    END AS 'description'
    FROM cases
    $$
    DELIMITER ;
    Last edited by Meyer; 2011-06-02 at 04:25 PM. Reason: No Response

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: What am i doing wring mysql

    Not sure anyone here would be able to help, most of us are MySQL users and I'm not sure any of us would do that with a trigger, we would use a logic_hook in SugarCRM itself. Not that using a trigger shouldn't work or is a bad choice, its just not the normal choice when working in SugarCRM.
    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
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default Re: What am i doing wring mysql

    Hi thanks

    i got it right with insert ignore, and changing my mds.

    But i would love to know how to do a logic hook. as i am not a programmer but a normal administrator with minimum knowledge.

    and we use info@hand wich is built on sugar 4.5.

    please explain how i could create a logic hook from case to create a task?

    regards

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MySQL error 2006: MySQL server has gone away
    By fusionstaffing in forum Developer Help
    Replies: 1
    Last Post: 2009-09-25, 10:43 PM
  2. Connectiing MySQL GUITools (win) to view SugarCRM schema on MYSQL-UBUNTU
    By paulval in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2008-03-06, 08:10 PM
  3. Replies: 0
    Last Post: 2008-02-06, 11:09 PM
  4. Replies: 2
    Last Post: 2007-07-30, 02:58 AM
  5. Replies: 2
    Last Post: 2007-07-01, 09:55 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
  •