Submit a ticket
Logga in

Customization guide: extending oneflow application with custom logic


Oneflow integration provides wide functionality out of the box, but, if a customer has technical knowledge of Dynamics and understands how JSON format works and wants to extend the functionality of Oneflow extension with custom scenarios, it is possible to do that by reusing some of the Actions that are shipped with the solution. Below we’ll look at some generic cases on how to do that.

Example of solution

To make it easier for customers to customize Oneflow for their needs we have created demo solution that they can try out in their demo/test environment and adjust. (Solution (Zip package) is attached at the end).

To be able to use a solution it needs to be imported in the Dynamics: Settings - Solution - Import - Choose zip file from local drive and just click next for all steps:

Once done, the solution will be added to the list. 

We provide 2 processes that customers can modify. BPF allows customers to automatically trigger contract creation or change opportunity stage and status based on contract events. 

Oneflow custom entities.

It is possible to hook up your custom events to the states of your contracts and/or participants.

Tracking Oneflow contract statuses in Dynamics.

Each time a contract is created through integration with oneflow, a corresponding record is created in of_oneflowcontract  entity. The entity contains various fields, which are synced with Oneflow, which means that you can track and see the updates of your oneflow contracts in CRM almost in real time. This gives you opportunity to fire custom logic on multiple events of your contract.

Let’s look at the example and try to change the opportunity status when the contract status is changed too.

That’s pretty easy. We can just create a workflow that triggers on change of the of_oneflowcontract entity.

Let’s create a condition in our workflow. All the possible contract statuses are kept in the status reason field, and that’s the field we’re going to check.

The event we’re interested in this example is when the contract is signed, so we’ll check for this value.

Contracts are directly related to opportunities, so we can easily update them through our workflow:

That’s it!

Advanced techniques.

Changing BPF stages of your opportunity depending on the contract status.

If you have a custom Business process flow and would like to extend your business logic depending on what happens with your contract in Oneflow, a following technique can be used to do this with code-free customisation. We won’t cover custom javascript code to change BPF stages or perform logic here.

Let’s take an example when you want to change your BPF stage based on the contract status.

To do that, we would need to create flag fields on opportunity entity, that would indicate if an event we are interested in happened or not. 

For example, if we want to change BPF status when contract is sent, we will need to create a Boolean field on opportunity and name it “Is contract sent?” or similarly.

Then, we’ll need to use our previous chapter and set up a workflow that would update this value when the contract status changes:

Then, we will need to create new Workflow.  Since every Business Process flow is a separate entity now, we will need to create a workflow and hook it up to the entity you’re interested in. In our case, it’s Opportunity Sales Process:

!!! It’s important to run this workflow in the background if you want it to trigger on change of opportunity as we want the workflow to run only when the “contract sent?” field changes. !!!

We will need to check a condition to make sure the BPF is on the correct stage first:

We’re checking the Stage Category here because our BPF doesn’t contain duplicate categories. You can also verify active stage by its name, or even check the actual value in the lookup, whatever works best for you.

So, if our condition is satisfied, we would want to update our Business Process Flow:

Then click on “Save&Close” and that’s it! Just activate the workflow after that and it’ll start working.

Let’s see how it works:

We’ve created a contract and sent it to participants in our Oneflow account. Here’s how our opportunity looks:

After the workflow execution completes and we refresh the form, the stage is updated:

Hjälpte det här svaret? Ja Nej

Send feedback
Synd att vi inte kunde vara till hjälp. Hjälp oss förbättra denna artikel med din feedback.