Using the NotifyChoice() method
Use the NotifyChoice() form method when the algorithm that generates selection data is complex and you need the user to enter or select some data in addition to selecting the catalog item. In this scenario you have to call the NotifyChoice() method when all the data required for picking is generated.
The NotifyChoice() method alerts the form owner that picking or selection is finished, passes the selected value to the owner, and closes the form unless it is opened in multiple selection mode.
You can also use the NotifyChoice() method when you need to pass a custom data structure in addition to the selected catalog item (or array of items) to the document form.