I have setup formatted search based on query in sales order document to calculate remaining credit limit for particular customer based on outstanding transaction as per creation date. This function is working well when user creates document however it's not working (display wrong result) when user updating sales order document.
Question: how to set the value based on mode (Add/Update)?
Please find attach query for your reference. Thank you.