now when I am opening the new document field is taking the preious value. It is not refreshing. If suppose I saved Doc_no=100008 previously in database and when I again opening the new document it shows 100008 value on the field. But after refreshing manually it executes the formula and show the doc_no=100009.