Can't get NextActivityId

  

Hi Guys!


I'm developing a system to the HR of my company and i'm stuck right now with this same error.

In this system we have 2 types of processes flow:

  1.  Movement of a employee that is already in the company (like promotion or resignation);
  2. Open a new vacant job (like a temporary employee).


Both of this processes are pretty simmilars in the beginning.

This processes start which the manager filing in a form and send to a verification. 

At this step of the verification it is when the error comes out. After the designated employee do this verification, he send this form to be approved by the director. When I'm sendin' this form to the director, the system automatically creates all the steps of the approval (in order is something like, first the director approval, after the vice-president approval and finally the president approval), and there is the error. I have to send the NextActivityId (in this case, after the OK in the verify, the next activity should be the approval of the director) and i'm sending a 0.

I will attach some images of my process, because i really need someone of outside to see this in a diferent point of a view, I'm like 3 days trying to solve this and i'm really hard stuck on this.

All the help will be welcome.


 This is my process of the new job:



This is the server action off the "Send to approval" button:



This image shows the creation of all steps of the approval, when we save a new register:

As I said, I will be thankful with any help.

Regards,

Diego Costa.

Forgot the error message: