Below is the patch of code that is executed on the click event of the button.I am trying to Send the data table information from vb.net using microsoft business connector to axapta method as a parameter(Table Buffer).But following error occurs.
Unable to cast object of type ‘System.Data.DataTable’ to type ‘Microsoft.Dynamics.BusinessConnectorNet.AxaptaBuffer’.
is there any other solution to pass datatable infomation to axapta method as buffer ??
code i have used :-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim axRouteReference As AxaptaObject
Dim Buffer As AxaptaRecord
Try
AxaptaObj = AxaptaLogon(Gbl_Company)
buffer=AxaptaObj.CreateAxaptaBuffer()
axRouteReference = AxaptaObj.CreateAxaptaObject(“PwC_VB_Route”)
Buffer=vgrdRouteLines.DataSource
Call axRouteReference.Call("UpdateDataRouteJournalLines ", Buffer)
MsgBox(“Done”)
Catch ex As XppException
Call MsgBox(ex.Message)
End Try
AxaptaObj.Logoff()
AxaptaObj = Nothing
End Sub