Email case creation created by default user

We've implemented de inbound email automatic case creation. Following the next tutorial:

https://support.sugarcrm.com/Knowledge_Base/Email/Automatically_Creating_Cases_From_Inbound_Emails/ 

Everything is working fine, however we noticed all cases are created by a specfic user. Our guess its the default user/ the account administrator.

We would like to change this so its created by a user from a team or a different specific user.

Just to be clear we are talkin about the "Created by" field not the "Assignee"

We've tried the next code in the InboundEmail.php in ./costume/modules/InboundEmail/

handleCreateCase(...){
....
   $c->created_by = 'My.Username'
...
}

That would not work

Any guesses?

Parents
  • The idea that you have is correct.

    After
    $c->save(true);

     

    line in the handleCreateCase function, you can run a query to update the created_by column in the database, based on the $c->id value. This is, assuming that you have already set the setting of the assigned to the user. If you have already done that, then the user you want to assign to the created_by will be passed in the parameter and will be available in the $userId variable.

    Also, the path of your custom file should be

    ./custom/modules/InboundEmail/

    not

    ./costume/modules/InboundEmail/

    Kind Regards!
    Rolustech Support
    Email: support@rolustech.com 
    Website: www.rolustech.com 

Reply
  • The idea that you have is correct.

    After
    $c->save(true);

     

    line in the handleCreateCase function, you can run a query to update the created_by column in the database, based on the $c->id value. This is, assuming that you have already set the setting of the assigned to the user. If you have already done that, then the user you want to assign to the created_by will be passed in the parameter and will be available in the $userId variable.

    Also, the path of your custom file should be

    ./custom/modules/InboundEmail/

    not

    ./costume/modules/InboundEmail/

    Kind Regards!
    Rolustech Support
    Email: support@rolustech.com 
    Website: www.rolustech.com 

Children