Dear All,
I have one database, there is one form where around 60 fields are present.
As per workflow manager send filled form to security person for review, here security person has option that he can do some changes in form fields or without doing any of change he can click on review buton BUT if he changes something in any of the field (min 60 fields present in form) then on click of review button information email will go to manager.
Now my problem is how can I compare these 60 fields with old values.
I have one solution that I will create 60 hidden fields and compare these hidden field old values to current value(when document is pending to security person, onclick of review button) but this solution is very lenghty and it will increase database space also. I can not change the field names its old database.
Please suggest is there any other solution for this problem OR I will have do this old solution.
Thanks in advance
Subject: please suggest for lots of field
Add an onChange event to each field, and store a boolean value that a field was changed. Then when the doc is saved, check that boolean value, if a field was changed you could then act accordingly
Subject: RE: please suggest for lots of field
Hi Carl thank for your reply, Yes Boolean flag is fine but its difficult to control on onchange, for example i will up that flag on onchnage event but for example he did not change any value in radio button, he just click the new value and again select the old value then in this situation flag will be up but in actual he did not change any value.
Subject: RE: please suggest for lots of field
As long as you are talking about a document that will be opened in the user interface, you can create a global “shadow document” (it exists only in memory and is never saved) containing all of the current values (rather than adding and using hidden fields). The document object would have to be declared in the Form Globals, then populated in the PostOpen in order for it to be accessible from all other event code.
Subject: please suggest for lots of field
I do something similar in a couple of my applications. If any of a certain number of fields have been modified, some special action is to be performed.
What I did is to create a global list of strings and populate it with the values of all fields I want to check when the document is opened (or put in edit mode).
Then in QuerySave or PostSave (depends on what you are doing) I compare the values in the list with the current field values, and if any are different I perform the action.
Something like this:
Global Declaration:
Dim fieldValue List As String
PostModeChange:
If source.EditMode = True Then
fieldValue(“FirstFieldName”) = source.FieldGetText(“FirstFieldName”)
fieldValue(“SecondFieldName”) = source.FieldGetText(“SecondFieldName”)
fieldValue(“LastFieldName”) = source.FieldGetText(“LastFieldName”)
End If
PostSave:
changed = False
ForAll f in fieldValue
If uidoc.FieldGetText(Listtag(f))<>f Then
changed = True
End If
End ForAll
If changed Then
'*** Do your stuff here
End If
Something like that.