RE: How to change the ownerid on an account
Hi Andrew,
Below is a sample in VB.NET. I have commented out some of my other attempts.
Private Sub btnUpdateAccount_Click(sender As Object, e As EventArgs) Handles btnUpdateAccount.Click
Dim m_http As New MSXML2.ServerXMLHTTP60
Dim Responce As String = ""
Dim _json As New JSON
Dim tt() As JSON.AccountInfo
Dim JSON As String = ""
Try
'JSON = "{""value"": ""123456789""}"
'JSON = "{""value"":""/systemuser(151F639c-1c73-eb11-b1ab-000d3a253b40)""}"
JSON = "{entity[""ownerid@odata.bind""]=""/systemuser(151F639c-1c73-eb11-b1ab-000d3a253b40)""}"
'JSON = "{""ownerid@odata.bind"":""71872ae2-4eae-eb11-8236-00224881db1e""}"
' m_http.open("PUT", "/api/data/v9.2/accounts(6a09a29c-78c3-eb11-bacc-00224881adac)/accountnumber", False)
m_http.open("POST", "/api/data/v9.2/accounts(6a09a29c-78c3-eb11-bacc-00224881adac)", False)
m_http.setRequestHeader("Content-Type", "application/json")
m_http.setRequestHeader("Authorization", "Bearer " & pub_Token)
m_http.send(JSON)
Responce = m_http.responseText()
Catch ex As Exception
End Try
End Sub