lookup on creating reacord RRS feed

  • Question

  • I'm struggling with adding a new record  that has a lookup field

        <Microsoft.SqlServer.Server.SqlProcedure()> _
        Public Shared Sub OriginatingAccount_Create(LicenceNo As SqlString, BAccount As SqlString)
            Dim token As New CrmAuthenticationToken()
            token.AuthenticationType = 0
            token.OrganizationName = "XXXXXX"
            Using crmService As New CrmService()
                crmService.Url = "https://xxx.xx.xxx:xx/MSCRMServices/2007/CrmService.asmx"
                crmService.Credentials = New System.Net.NetworkCredential("xxx", xxxx", "xxx")
                crmService.CrmAuthenticationTokenValue = token
                crmService.UnsafeAuthenticatedConnectionSharing = True
                crmService.PreAuthenticate = True
                If LicenceNo.Value IsNot Nothing Then
                    Dim Oaccount As New new_clientoaccounts
                    Oaccount.new_licence = LicenceNo.Value  ‘ This is where I am having a problem. New_licence is a lookup on accounts. Accounts have a 1 : N lookup on new_clientoaccounts.
                                                                                                                                            I have been looking at threads, but cannot grasp what I need to do
                    Oaccount.new_accountnumber = BAccount.Value
                End If
            End Using
        End Sub

    Dont ask me .. i dont know

    Tuesday, July 30, 2013 9:42 AM


All replies