I have formula fields which calculates the net value and total value for sales order object, I want to change these formula fields values but not affect the old value for sales order which is packed, how to do that? I thought about setting a date and time in the formula field and compare the packing time with these date and time, if it is old and packed then the formula value is the old one, if it is newer then calculate it based on the new one, this looks a bit weak, any suggestions?
If you want a formula which will calculate different data, you should create a new field. Trying to store two different data points in the same calculated field is a path to madness.
If you are determined to store both values in one field, it would still be better to preserve the old calculation and add the new calculation in a separate field. You can then add a third formula for output purposes.
If you want to preserve historic data, you will need a writeable field and workflow rule, as suggested in the comments. That's what I gathered from your original post, but based on your own comments I wrote the above instead.
I solved it by using a date field in the formula field like this:
IF(CONTAINS("USD;CAD:US",text( CurrencyIsoCode )),Net_Order_Total_From_Quote__c, Case (text( CurrencyIsoCode ), "SEK",*IF(PBSI__Packing_Date__c>Date(2018,10,18), Net_Order_Total_From_Quote__c-(0.25*Net_Order_Total_From_Quote__c), Net_Order_Total_From_Quote__c) ,* "EUR",(Net_Order_Total_From_Quote__c )/ (1 + $Setup.VAT__c.Belgium_VAT__c) , "GBP",(Net_Order_Total_From_Quote__c ) / (1 + $Setup.VAT__c.UK_VAT__c), 0)) ...... the rest of the formula