I have made an Application in VB.Net Using Micorsoft Business Connector where i used axapta logic. i logon to axapta and use the methods in axpata class when i logoff the axapta ,i also destroy the axapta object in vb.net.But still the user is shown in the axapta online users list.
Following code write in my vb.net application :-
Public Function AxaptaLogon(ByVal company As String) As Microsoft.Dynamics.BusinessConnectorNet.Axapta Try AxaptaObj = New Axapta AxaptaObj.Logon(company:=Trim(company), language:="", objectServer:=Trim(Gbl_ObjectServer), configuration:="") AxaptaLogon = AxaptaObj Catch ex As XppException AxaptaObj.Dispose() MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Login error") AxaptaLogon = Nothing End End Try AxaptaObj = Nothing End Function
Private Sub FillCompanyLookup() Dim axRouteReference As AxaptaObject Dim CompanyBuffer As AxaptaRecord Dim Dt As New DataTable Dim Ds As New DataSet Dim dr As DataRow Try Dt.Columns.Add("ID", System.Type.GetType("System.String")) Dt.Columns.Add("Name", System.Type.GetType("System.String")) AxaptaObj = AxaptaLogon(Gbl_Company) axRouteReference = AxaptaObj.CreateAxaptaObject("PwC_VB_Route") CompanyBuffer = axRouteReference.Call("dataarea") Do If CompanyBuffer.Field("ID") <> "" Then dr = Dt.NewRow dr("ID") = CompanyBuffer.Field("ID") dr("Name") = CompanyBuffer.Field("Name") Dt.Rows.Add(dr) End If Loop While CompanyBuffer.Next Ds.Tables.Add(Dt) cmbCompany.Properties.DataSource = Ds.Tables(0) cmbCompany.Properties.DisplayMember = "ID" cmbCompany.Properties.ValueMember = "ID" Catch ex As XppException Call MsgBox(ex.Message) End Try AxaptaObj.Logoff() AxaptaObj = Nothing CompanyBuffer = Nothing axRouteReference = Nothing cmbCompany.Text = Gbl_Company End Sub
How do i show the correct no.of users in the online users list...when i logoff .