Results 1 to 6 of 6

Thread: Help Help Help - im like a fish outa water here

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

    Exclamation help with relationship

    Good morning all!

    Here lies my problem.

    Im in contact screen and go to create a new case, go to full form and it builds a relationship with contact 100%. etc.

    but i build a workflow to say that the moment a case is created where case type = xxx then create a task yyy. this tash is related to the case and not the contact. i have to go into the task and then click on contact and link it to the contact.

    how can this be done automatically when case is created?

    cheers

    paul
    Last edited by Meyer; 2007-09-27 at 06:14 AM. Reason: no response

  2. #2
    Triffid is offline Member
    Join Date
    Jan 2006
    Posts
    5

    Default Re: Help Help Help - im like a fish outa water here

    automation of task creation should be done by using logic hooks

    I did a few, an example of one is where a case is created. Upon creation the case needs 3 tasks with different users assigned.
    in custom/modules/Cases i created a new logic_hook.php with the following contents:
    Code:
    <?php
        $hook_array['before_save'][] =
            Array(1,
            'createTask',
            'modules/Cases/create_case_task.php',
            'case_create_task',
            'createTask');
    ?>
    then in modules/Cases make a new file named case_create_task.php
    and put the following in:
    Code:
    <?php
    
    class case_create_task {
    
        function createTask(&$bean, $event, $arguments) 
        {
    	}
    
     }
    ?>
    Do whatever you need to do in the function createTask
    If you need more info PM me

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

    Wink Re: help with relationship

    Quote Originally Posted by Meyer
    Good morning all!

    Here lies my problem.

    Im in contact screen and go to create a new case, go to full form and it builds a relationship with contact 100%. etc.

    but i build a workflow to say that the moment a case is created where case type = xxx then create a task yyy. this tash is related to the case and not the contact. i have to go into the task and then click on contact and link it to the contact.

    how can this be done automatically when case is created?

    cheers

    paul
    We were talking about this today and I think we came up with a solution that might work, I have not tested it at all so bear that in mind.

    Use two workflows.

    Workflow #1
    Based on Cases, updates a custom text field in contacts (you dont even need to show the custom field on a view). We will call the text field "Case_Started"

    -Set "Case_Started" = 1.

    thats it for workflow #1

    Create workflow #2
    Based on Contacts
    When "Case_Started" changes value and the new value is "1"
    -Create a task related to this contact
    -Set the value of "Case_Started" = 0


    It looks a little clunky but it should work. Let me know
    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

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

    Default Re: Help Help Help - im like a fish outa water here

    thanks a lot, but is workflow not triggered by saving a module? dont you have to be in contacts module and save the contact before the workflow takes action?

    thanks

    Paul

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

    Default Re: Help Help Help - im like a fish outa water here

    No, not really, a workflow is trigger by a save. The first workflow changing a field, does so by saving the record, thus triggering the workflow. You don't have to manually save a record to trigger a workflow
    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

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

    Default Re: Help Help Help - im like a fish outa water here

    nope, not kicking the workflow of either

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. So Long Sugar, and thanks for all the fish
    By alsutton in forum General Discussion
    Replies: 41
    Last Post: 2006-11-15, 07:57 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
  •