• somasundaram s 7
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
hi guys,

I will try getting Inactive roles using soql .I unable to do this.If you know kindly share to me .


Thanks ,
Somu
hi guys,

i will try to create and update a record in SFDC via API. I have acheived to create a Record .But I can't able to update  the Record via API . 

Here is my sample code :
        public void UpdatedRecordforAccount()
        {
            //0017F00000b9EnPQAU
            HttpClient client = new HttpClient();
            string requestMessage = "{\"Name\":\"Express Logistics and Transport Sample\"}";


            HttpContent content = new StringContent(requestMessage, Encoding.UTF8, "application/json");            
            string uri = InstanceUrl + API_ENDPOINT + "sobjects/Account/0017F00000b9EnPQAU" + "?_HttpMethod=PATCH";

            //create request message associated with POST verb
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri);

            //add token to header
            request.Headers.Add("Authorization", "Bearer " + AuthToken);

            //return xml to the caller
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            request.Content = content;
            var response = client.SendAsync(request).Result;
            Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            Console.ReadLine();
        }

I have already tried these two method (http put,post) and _Patch concept. If any have a solution .please share to me 
HI Guys ,

I will try to updated the existing user record . Here is the my sample code ,
  HttpClient client = new HttpClient();
            string requestMessage = "{\"NewPassword\":\"sv0xHAuM\"}";


            HttpContent content = new StringContent(requestMessage, Encoding.UTF8, "application/json");
            //string requestMessage = "<root><name>DevForce21</name><accountnumber>8994432</accountnumber></root>";
            //HttpContent content = new StringContent(requestMessage, Encoding.UTF8, "application/xml");
            string uri = InstanceUrl + API_ENDPOINT + "sobjects/User/0057F000002uZLMQA2" + "?_HttpMethod=PATCH";

            //create request message associated with POST verb
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Put, uri);

            //add token to header
            request.Headers.Add("Authorization", "Bearer " + AuthToken);

            //return xml to the caller
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            request.Content = content;
            var response = client.SendAsync(request).Result;
            return response.Content.ReadAsStringAsync().Result;         
.I am getting the error "Method Not allowed ".

Kindly advice to fix this issue.
Hi Guys ,

I have using Developer account for SFDC then i have collected wsdl file from that account to add my reference in my project using VS 2017. I will try to acces the SFDC Account . I can able to login that account using soapclient . But, I unable  to create a new user from my VS 2017 to SFDC Account .  

Can you share tips to me.

Thanks ,
SOmu
hi guys,

i will try to create and update a record in SFDC via API. I have acheived to create a Record .But I can't able to update  the Record via API . 

Here is my sample code :
        public void UpdatedRecordforAccount()
        {
            //0017F00000b9EnPQAU
            HttpClient client = new HttpClient();
            string requestMessage = "{\"Name\":\"Express Logistics and Transport Sample\"}";


            HttpContent content = new StringContent(requestMessage, Encoding.UTF8, "application/json");            
            string uri = InstanceUrl + API_ENDPOINT + "sobjects/Account/0017F00000b9EnPQAU" + "?_HttpMethod=PATCH";

            //create request message associated with POST verb
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, uri);

            //add token to header
            request.Headers.Add("Authorization", "Bearer " + AuthToken);

            //return xml to the caller
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            request.Content = content;
            var response = client.SendAsync(request).Result;
            Console.WriteLine(response.Content.ReadAsStringAsync().Result);
            Console.ReadLine();
        }

I have already tried these two method (http put,post) and _Patch concept. If any have a solution .please share to me 
HI Guys ,

I will try to updated the existing user record . Here is the my sample code ,
  HttpClient client = new HttpClient();
            string requestMessage = "{\"NewPassword\":\"sv0xHAuM\"}";


            HttpContent content = new StringContent(requestMessage, Encoding.UTF8, "application/json");
            //string requestMessage = "<root><name>DevForce21</name><accountnumber>8994432</accountnumber></root>";
            //HttpContent content = new StringContent(requestMessage, Encoding.UTF8, "application/xml");
            string uri = InstanceUrl + API_ENDPOINT + "sobjects/User/0057F000002uZLMQA2" + "?_HttpMethod=PATCH";

            //create request message associated with POST verb
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Put, uri);

            //add token to header
            request.Headers.Add("Authorization", "Bearer " + AuthToken);

            //return xml to the caller
            request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            request.Content = content;
            var response = client.SendAsync(request).Result;
            return response.Content.ReadAsStringAsync().Result;         
.I am getting the error "Method Not allowed ".

Kindly advice to fix this issue.