Hi Clemens,
Thanks for your reply. The problem for me is that the documents get created in the next page. There is a navigation from the Search screen to the result screen. When I click on Generate button in the search screen it navigates to the next screen to show the list of Materials and their corresponding PI document #. Also, in some cases the item list could be short and also based on serialized materials the time could differ.
With the above scenario...I doubt this would work...your thoughts?