Good afternoon, I have a web application to create internal documents in Spring ERP. The problem is that each document takes, on average, 2 to 3 minutes to be created. When the document has 1 or 2 lines it takes but creates, but when it takes more time to give the error: "The time limit for the request has expired.". Does anyone know why this happens? Is there any way to optimize the code / some configuration in IIS that solves the problem?
Here is the code:
Dim documento As New GcpBEDocumentoInterno
documento.Tipodoc = "RI"
documento.Entidade = "001"
documento.TipoEntidade = "F"
documento.Serie = "2018"
If Len(txtObs.Text) > 0 Then
documento.Observacoes = txtObs.Text
End If
documento.DataEntrega = timePicker1.Value
PriEngine.Engine.Comercial.Internos.PreencheDadosRelacionados(documento)
For Each row As GridViewRow In gvLinhas.Rows
Dim linhas As New GcpBELinhasDocumentoInterno()
PriEngine.Engine.Comercial.Internos.AdicionaLinha(documento, row.Cells(0).Text,,,,,, Convert.ToDouble(row.Cells(2).Text))
Next
Try
PriEngine.Engine.Comercial.Internos.Actualiza(documento)
Catch ex As Exception
ClientScript.RegisterStartupScript(Me.GetType(), "alert", "alert(""" & "Não foi possivel gravar o documento. "");", True)
End Try
Thank you very much.