How do we edit something?

Hello all, I need some help!

I can create an invoice on my app and then generate a PDF of the invoice. However, if the I later edits that invoice, the PDF doesn’t generate this time?

Something to note, once the PDF has been sent, I delete it from the database as it is no longer needed, so this means editing an invoice should be even easier, it it should generate a fresh PDF but I get none.

I have tried adding a second step in the workflow to generate a pdf When invoice's PDF is empty but this didn’t work. Any ideas most welcomed.

How did you generated the first PDF?! Why don’t you use the same workflow with the new invoice values?

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:



When I look at the second screenshot of debugger, I find the constraint missing.
Can you try using a different custom event when invoice value is not empty

I don’t see the constraint missing, would you mind showing a screen shot with an arrow? Also, do you think I should try using a different custom event even though it is now working? Do you think I have set it up wrong?