Hello,
I am using Forms 10.3.0.975. I have a stored procedure that is set to run whenever the autofill button is clicked, however I can 100% replicate that if the stored procedure is in place, it causes the form initial load time to increase to more than 2 minutes. Does forms run the configured stored procedures on load for some reason?
The procedure is attached below. It uses dynamic sql to search a table for records. This is done because they may check one of several options to search by and it didn't make sense to create separate stored procedures for every single search combination. They will also be adding 4 additional criteria, so it becomes an exponential number of possible combinations.
ALTER PROCEDURE [dbo].[SearchOrdersByOrderNumberAndCustomerNumberAndDateTEST] @custnum int = NULL, @ordernum int = NULL, @company nvarchar(16) = NULL, @orderstatus int = NULL, @SearchStartDate datetime = NULL, @SearchEndDate datetime = NULL AS DECLARE @sSQL NVARCHAR(2000), @Where NVARCHAR(1000) = '' SET @sSQL = 'SELECT custnum, PROGRESS_RECID_IDENT_, orderdate, ponum, ordernum, openorder FROM [LB_Progress2].[dbo].[orderhed] ' IF @orderstatus is not null and @orderstatus <> '' SET @Where = @Where + 'AND openorder = @_orderstatus ' IF @company is not null and @company <> '' SET @Where = @Where + 'AND company = @_company ' IF @custnum is not null SET @Where = @Where + 'AND custnum = @_custnum ' IF @ordernum is not null and @ordernum <> '' SET @Where = @Where + 'AND ordernum = @_ordernum ' SET @Where = @Where + 'AND custnum <> ''0'' ' SET @Where = @Where + 'order by orderdate ' IF LEN(@Where) > 0 SET @sSQL = @sSQL + 'WHERE ' + RIGHT(@Where, LEN(@Where)-3) EXEC sp_executesql @sSQL, N'@_custnum int, @_ordernum int, @_company nvarchar(16), @_orderstatus int, @_SearchStartDate datetime, @_SearchEndDate datetime', @_SearchStartDate = @SearchStartDate, @_SearchEndDate = @SearchEndDate, @_orderstatus = @orderstatus, @_company = @company, @_custnum = @custnum, @_ordernum = @ordernum