As part of a migration to a new database structure I have created a button in a source document (thisSource) to perform the following actions: - create a new order document (targetOrder)
- populate new order from fields in the open source document (thisSource)
- make the source document (thisSource) a response to a new order document (targetOrder)
- change form used for thisSource to new form ("fResponse")
Currently, I am trying to identify the targetOrder by finding the last record in a view, but is there a better way? Can I capture the uniqueID of the newly created targetOrder and use that instead?
Also, would it be better to have the button in a view and use a selected document as a source instead?
Another refinement might be to prompt the user whether they want to make the source document a response to an existing order document or to create a new order document, as I’ve tried to do here.
You’ll see from this code that I’m a LotusScript novice. This is my non-working code - I’ve commented what I’m trying to achieve at each point - hopefully this might explain where I’m going wrong!
Your suggestions very very welcome!