AnsweredAssumed Answered

Creating a Workflow through code

Question asked by janunez on Sep 10, 2015
Latest reply on Oct 27, 2015 by José Bernaez
Hi everyone,

I want to share one example of doing a workflow through code. Many times our customers have asked us to implement some processes and this is our best practice we can done.

In this example we got some processes regarding with the "Sales Stage" field in the Opportunity record and regarding with the "Amount" field of the Opportunity. You can extend this code to any core module or custom module.

In our example the process is:
  1. When creating a new Opportunity a Task and a Call records are created.
  2. When an Opportunity change from "Proposal/Price Quote" to "Negotiation/Review" an email is sended to all users within role "Sales Manager".
  3. When an Opportunity change to "Closed Won" a curl call is sended to an external app, that could be your ERP for example.
The full code is available in:

I hope this example would be useful for you to understand the use of logikhooks and using this code as a template for your own purposes.

Best Regards,

Javier Núñez

Audox Ingeniería Ltda.
Phone: +56 2 2581 3799
Mobile: +56 9 9675 0572
Skype: audox.ingenieria