UPDATE: I have just fixed this issue but my fix makes no sense! I will leave the rest of my reply as it had more detailed info, but here’s the fix;
When I create an invoice I referred to Result of step 1 (create a new invoice)
, but as a test I created a second step and also referred to Result of step 2 (make changes to invoice)
. This showed a PDF on edit but not on first creation (the opposite problem from before).
After trying many combinations, the thing which worked was added the constraint in Step 5’s Result of step 2 (make changes to invoice) which says
When create-invoice’s Invoice is empty. This solved the issue but I would have thought it should have been
When create-invoice’s Invoice is not empty`
I wanted to say that when we are editing, ie. the invoice is not empty, then refer to the Result of step 2 (make changes to invoice). But instead it only works is
When create-invoice’s Invoice is empty`. I have no idea why this works!
ORIGINAL REPLY
I did try that but I am doing something wrong. I went through with the debugger but don’t see any issues. Should an edit workflow be different to a normal workflow?
When a user has filled out the invoice for the first time they click Preview, this then triggers an event to save the invoice and then to create a PDF;
That event to save the invoice looks like this:
Then the event to generate a PDF kicks in, it looks complicated but it just generates all the elements to show on a PDF, the event workflow is like this:
The result is that the user is taken to a new group called ‘preview-invoice’ and they see the PDF. If they go back later and edit their invoice, the Preview button successfully edits the invoice but ‘preview-invoice’ is empty, showing no PDF?
The only thing which I noticed in debug mode was an empty Workflow folder, but I’m not sure what this is;
Some other screen shots from debug: