Quantcast
Channel: CRM Development 論壇
Viewing all articles
Browse latest Browse all 10280

lookup on creating reacord

$
0
0

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
                crmService.Ceeate(Oaccount)
            End If
        End Using
    End Sub


Dont ask me .. i dont know


Viewing all articles
Browse latest Browse all 10280


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>