Thank you for your response.
I have already set tested by setting UpdatePropogation = FALSE. So, Subpage is not updating main page.
Also, I have removed all Fact Boxes and its related code, flow fields from Header and Line Pages.
I have tested that Code execution is completed within 3-4 seconds. But Page controls refreshing is taking time and it takes around 30 Seconds.
Scenario is below:
I enter Line and quantity on it. It opens new subpage where default Items are already selected to add with entered item. I just click ok and then it takes 30 seconds until I get control back.
I have already rebuild SQL Indexes, increase Database Case Size. But, it does not help.
Client is on BC19 on SaaS version and provider is InTwo company. I think it is not code issue as I have already debugged and kept only necessary code.
Any suggestion is appreciated.