Android Question Problema al ingresar a una actividad

caparicio

Member
Licensed User
Longtime User
anywheresoftware.b4a.B4AUncaughtException
at anywheresoftware.b4a.Msgbox.msgbox(Msgbox.java:168)
at anywheresoftware.b4a.keywords.Common.Msgbox2(Common.java:436)
at anywheresoftware.b4a.keywords.Common.Msgbox(Common.java:415)
at prismatec.prismatec.koeventas.ingresopedido._revisalimite(ingresopedido.java:2912)
at prismatec.prismatec.koeventas.ingresopedido$ResumableSub_Activity_Create.resume(ingresopedido.java:544)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1654)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5530)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:733)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:623)
 

Cableguy

Expert
Licensed User
Longtime User
Without any other info, like a bit of code, all I can tell is that the error is caused by a messagebox
 
Upvote 0

caparicio

Member
Licensed User
Longtime User
B4X:
Public Sub RevisaLimite(IndicadorSaldo As String)
    Dim MontoDiario As Double = 0
Dim FechaActual As String
FechaActual = DateTime.GetYear(DateTime.Now) & RightStr("00" & DateTime.GetMonth(DateTime.Now), 2) & _
RightStr("00" & DateTime.GetDayOfMonth(DateTime.Now), 2)
    Dim Encontrado As Boolean = False
    Dim SaldoEncontrado As Double = 0
    If IndicadorSaldo = "1" Then
Dim SqlTxt As String =""
Dim rs As Cursor
        SqlTxt = "SELECT COALESCE(SUM(CTRMON), 0) AS CTRMON FROM CTRLIMDI WHERE CTRFEC='" & FechaActual & "' AND CTRCLI=" & Starter.Codigo
        rs = Starter.SQL1.ExecQuery(SqlTxt)
        If rs.RowCount>0 Then
rs.Position = 0
            MontoDiario = CDbl(rs.GetString("CTRMON"))
        Else
            MontoDiario = 0
EndIf
        rs.Close
        SqlTxt = "SELECT A.LCRUT,A.OUTNUM,B.LCCRED,B.LCDEUD FROM LCRCLI AS A INNER JOIN LCTRUT AS B ON (A.LCRUT=B.LCRUT) WHERE A.OUTNUM=" & Starter.Codigo
        rs = Starter.SQL1.ExecQuery(SqlTxt)
        If rs.RowCount>0 Then
rs.Position = 0
            SaldoEncontrado = CDbl(rs.GetString("LCCRED")) - CDbl(rs.GetString("LCDEUD"))
            Encontrado = True
        End If
        rs.Close
        If Encontrado = False Then
            SqlTxt = "SELECT MONCRE,SALCRE FROM RASIGNAN WHERE CCLIE=" & Starter.Codigo & " AND FVENC>=" & FechaActual
            rs = Starter.SQL1.ExecQuery(SqlTxt)
            If rs.RowCount>0 Then
rs.Position = 0
                SaldoEncontrado = CDbl(rs.GetString("SALCRE")) - MontoDiario
                Encontrado = True
            End If
            rs.Close
        End If
        If Encontrado = True Then
Msgbox("Límite de crédito disponible " & NumberFormat(Round2(SaldoEncontrado, 2), 0, 2).Replace(".","_").Replace(",",".").Replace("_",","), "")
        End If
    End If
EndSub
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Try to replace the message box string to a simple one, to establish if in fact it's the msgbox fault, then build the msgbox text up... I'm betting that one of the SQL calls is not returning a valid value...so your ifs are not being correctly triggered.

Also...
If encontrado = true then
....
Else if encontrado = false then
...
End if
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Área you algo using the New okhttputils2?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Sorry , I went the wrong way. ...
Il meant the SQL calls...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…