[Vtigercrm-developers] Salesorder to Invoice Convert gets stopped, Workflow/Eventhandler problem

Lennart van Ballegoij lennart at egmmedia.nl
Mon Mar 14 23:07:44 GMT 2016


Hey guys,


I’ve got a problem and I was wondering if anyone has encountered a similar
problem or anyone has a guess what’s causing my problem.


I have a workflow created through the module: Workflow Designer that
converts a Sales order to an Invoice, I also have a custom module with an
Event handler that launches on a after save event of the Invoice module.

When launching the workflow that converts the Sales order to an Invoice I
get a blank page.

If I check invoices, is do see that the invoice is created, but it has no
items (products) assigned to it.

I understand an Invoice is created in 2 steps:

            -Step1 all fields get saved.

            -Step2 All attached items get saved.


So it looks like my ‘vtiger.entity.aftersave’ event is being called on
Step1 and for some reason stops the Invoice from being created.

So after realizing it’s probably because my Handler gets called in Step1 of
the Invoice save, I build in a check in my Module Handler to see if the
created invoice contains items (products) if not my script does nothing
else.


But I still get the blank page even after creating this check in my
EventHandler.


Do I maybe need to tell my EventHandler to continue; or something like that
after it sees it has no items assigned to the invoice?


Hopefully someone can give me a push in the right direction.

Thanks in Advance!


Kind Regards,


Lennart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20160315/4fc1c9f1/attachment-0001.html>


More information about the vtigercrm-developers mailing list