Sub load_clients
Try
'#Tabla: b004: Search basic info of clients
'#Input: us_id
'#Return: indece, cuit_client, ratio_social, name, condition_iva, fantasy_name
'sql.user_clients_b004=Select indice, cuit_client, ratio_social, name, condition_iva, fantasy_name FROM b004 /
'WHERE us_id = CAST(? As BIGINT) And date_down Is NULL;
'arg: It was define as private variant in current activity: private arg As Object
arg = Array(Starter.us_indice)
'exe_sql_query: It was define as sub in the current Activity: Return query_success as boolean and query_result as list; Both define as private variant in current activity
exe_sql_query("user_clients_b004")
wait for exe_sql_query_complete
LogColor("user_clients_b004: " & query_success, Colors.Green)
If query_success Then
If query_result.Size > 0 Then
Dim index_row As Int
Dim text_cast As String
Dim client_name As String
us_clients.clear
Dim basic_info As List
basic_info.Initialize
For Each fila() As Object In query_result
basic_info.clear
'0. indice
'1. cuit_client
'2. ratio_social
'3. name
'4. condition_iva
'5. fantasy_name
basic_info.AddAll(Array As String(fila(1),fila(2),fila(3),fila(4),fila(5)))
index_row = fila(0)
'-------------------THIS MAP HAS THE UNKNOWN PROBLEM
us_clients.Put(index_row, basic_info)
'---------------------
'-----------For the search machine
'Filling the map in two times: by cuit_client; by full name
text_cast = fila(1)
us_machine_clients.Put(text_cast,fila(0))
If fila(5) <> Null Then
client_name = " (" & fila(5) & ")"
Else
client_name = ""
End If
''-------------------THIS MAP WORKS PERFECTLY
us_machine_clients.Put(fila(2) & ", " & fila(3) & client_name, fila(0))
Next
End If
End If
Catch
Dim message_error As String = "load_clients " & " - [Error]: " & LastException
fCom.load_reg(message_error)
fCom.save_reg
LogColor(message_error, Colors.RGB(223,129,27))
End Try
CallSubDelayed(Me, "load_clients_complete")
End Sub