Something is weird here, since I can edit these two fields (both custom fields) in createview (but not in editview) while both are set to displaytype 4
I feel like the workflow is launching on a false positive, checking the value of the custom field against the sum_nettotal field when the sum_nettotal field is still 0. Since the custom field that aggregates the invoices starts out at zero as well, the date is filled. When I disable the workflow task, the date field stays empty
So basically, to sum up all the madness:
I think I've hacked this by adding a condition: I added the condition that 'Last modified' by can not be empty. This will prevent the date field from being filled in at the first save of the salesorder. I can't really test if it does what I want it to do when the salesorder is actually completely invoiced, since I can't create invoices on a production system without the invoice no.'s increasing (and you need consecutive numbers for the tax guys). I will monitor this and see what happens.
I feel like the workflow is launching on a false positive, checking the value of the custom field against the sum_nettotal field when the sum_nettotal field is still 0. Since the custom field that aggregates the invoices starts out at zero as well, the date is filled. When I disable the workflow task, the date field stays empty
So basically, to sum up all the madness:
- I created two custom fields on salesorders: one aggregates all the invoice net totals, the other is a date field
- I created a workflow that checks the aggregated field (that holds the sum of all the invoices) against the sum_nettotal field of the salesorder. That workflow works untill the first time a condition is true:
- The condition is: the aggregated field that holds the sum of all invoice net totals should be equal of bigger than the sum_nettotal value of the salesorder, ergo: the salesorder is completely invoiced
- At that moment, the second custom field should be filled with today's date
I think I've hacked this by adding a condition: I added the condition that 'Last modified' by can not be empty. This will prevent the date field from being filled in at the first save of the salesorder. I can't really test if it does what I want it to do when the salesorder is actually completely invoiced, since I can't create invoices on a production system without the invoice no.'s increasing (and you need consecutive numbers for the tax guys). I will monitor this and see what happens.