How to detect changes in a field

Hi,

I have a field autoattach_0 and autoattach_1. in first field. the documentunid is present and in another field attachment is present. This attachment is dependent upon the content of field autoattach_0.

Now, if user has changed the content of the field autoattach_0, then only I want to upload the attachment in to field autoattach_1 otherwise nothing should be done.

How to detect whether user has changed the content of the field?

I tried a hidden computed field and in that placing the contents of autoattach_0…If the content of this field and autoattach_0 are different, then only the code should be executed…but it is not working this way…

How to achieve this…

Please reply asap.

Thanks in advnce.

Subject: how to detect changes in a field

Hi Aadi,

You should have an hidden field… on save of the document the first time, the hidden field gets filled with the original value.

Then, each time you save your document, the code that create the attachment needs to compare value between both fields, and then, if it is different, create a new attachement. Once the new attachment is done, your code should update the hidden field with the new value… uppon next changes.

I hope this help.

Subject: RE: how to detect changes in a field

Tho code which is creating the attachment is present on queryclose and I cant transfer to any other event of the form…when i save the document, the hidden field will have the current value and when compared the contents of the two field will always match . Due to which the change can not be detected…

nywats…do let me know how can I do that…

thanks for the advice…

aditya…

Subject: RE: how to detect changes in a field

Sure it is a problem. The Queryclose event comes after the QuerySave.

You should try to find a way to move that code to the querysave event.

You should not use the queryclose event to set values in fields.