Hi Mark,
How about using 2 forms and deriving the 2nd one from the 1st where the prepopulated data is set to read-only?
Scenario:
1. Corporate employee #1 fills out form A and clicks submit
2. Submit saves form A to the network drive, opens form B passing it a reference (refID) to form A (more on that below), and closes form A
3. Form B's OnLoad code detects initialization (refID not set), sets the refID, sends e-mail and closes.
4. Corp employee #2 receives e-mail and double clicks on form
5. Form B's OnLoad code sees that the refID is set and loads Form B into a secondary data source that is bound to the main view using read-only controls.
6. Corp employee #2 fills out the editable fields in the form and saves.
7. Form B saves to net drive. The only data that is saved by the employee is the data they entered and a refID to the pre-fill form.
Form A should call NewFromSolutionWithData and pass an XML to form B that contains the refID of the existing form. That means after it is submitted. This is not hard to do. Another approach to passing the refID is to open form B and set the form's values from form B - Greg has a HowTo on how to communicate between forms.
Limitations of this solution:
- Employees must be connected to corporate network for form B to load form A data and show to user.
- Corp employees filling out form A will see another form open and close - not an integrated UI experience.
- It is still possible for corp employee 2 to manually modify the refID, but that will change all of the pre-fill data and not just one field. In addition, the bar is raised since they have to figure out the refID and manually edit in Notepad. You could further obfuscate using a GUID (global unique identifier) which is even harder for humans to deal with since it's 16 characters. If you absolutely must protect, you could digitally sign a section containing just this refID and that would protect it.
There are other options, but this is my idea for tonight.
Patrick Halstead
Project Manager at Qdabra