Sub icon_share_Click
Dim index As Int
Dim m As Map
Dim text_compartir As String
Select posicionTabScript
Case WS_TODOS
index= clv_todos.GetItemFromView(Sender)
m=lista_embarques_todos.Get(index)
Case WS_MARITIMOS
index= clv_maritimo.GetItemFromView(Sender)
m=lista_embarques_maritimo.Get(index)
Case WS_AERERO
index= clv_aereo.GetItemFromView(Sender)
m= lista_embarques_aereo.Get(index)
Case WS_WAREHOUSE
index= clv_warehouse.GetItemFromView(Sender)
m= lista_warehouse.Get(index)
End Select
If posicionTabScript= WS_WAREHOUSE Then
If idioma_actual="ES" Then
text_compartir="Agente: "&m.Get("nombreAgente")&CRLF&"Warehouse: "&m.Get("idWarehouse")&CRLF&"F. recep: "&m.Get("fechaRecepcion")
Else
text_compartir="Agent: "&m.Get("nombreAgente")&CRLF&"Warehouse: "&m.Get("idWarehouse")&CRLF&"Recep. Date: "&m.Get("fechaRecepcion")
End If
Else
If idioma_actual="ES" Then
text_compartir ="Pedido: "&m.Get("pedido")&CRLF&"Origen: "&m.Get("puertoEmbarque")&CRLF&"Destino: "&m.Get("puertoDestino")&CRLF&"Estado: "&m.Get("estadoEmbarque")&CRLF&"ETD: "&m.Get("fechaSalida")&CRLF&"ETA: "&m.Get("fechaLlegada")
Else
text_compartir ="Order: "&m.Get("pedido")&CRLF&"Origin: "&m.Get("puertoEmbarque")&CRLF&"Destination: "&m.Get("puertoDestino")&CRLF&"State: "&m.Get("estadoEmbarque")&CRLF&"ETD: "&m.Get("fechaSalida")&CRLF&"ETA: "&m.Get("fechaLlegada")
End If
End If
Try
Dim avc As ActivityViewController
avc.Initialize("avc", Array(text_compartir,Null))
avc.Show(Page1, Page1.RootPanel) 'Second parameter is relevant for iPad only. The arrow will point to the view.
Catch
Log(LastException)
End Try
End Sub