Workflow rule not being triggered

Workflow rule not being triggered

I have a custom function for my Quote module that creates a discount total from individual line items discount values and puts it back into a field in the record - and is then printed out on the quote. If I run it manually from the function editor - copying and pasting the Quote ID  when prompted, the function executes just fine. So I created a workflow which calls the function whenever any quote is created or edited. The function gets called (I checked on the quote's timeline), but the field is not updated. I added an email notification to the workflow to ensure that the automation is truly catching the edit, which it does - I do get the email. But still, the function doesn't update the field- I have to manually copy the quote ID and paste it into the input box when I manually run the function, and then everything works. So run manually, everything works, but when run from a workflow rule, the result is not returned. 

Is there any way for me to look at the function in real time to see what is actually being passed to/picked up by it, and the result?