• vino1.395228003587918E12
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
Hi,
I have fetched the AsyncApexJob from .Net.
In SOQL i got the "Bind variables only allowed in Apex code" Error.

My code is:

string res = "Failed";
            QueryResult query = null;
            string soql;
            soql = "SELECT Status,JobType,NumberOfErrors,CompletedDate FROM AsyncApexJob WHERE Status="+res+"";
            query = sfdcbind.query(soql);

Anyone help to solve this.
HttpClient updateclient = new HttpClient();


            string requestMessage = "<root><name>test</name></root>";
            HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/xml");

            //string requestMessage = "{\"Name\":\"DevForce20\"}";
            //HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/json");

string updateurl = serviceUrl + "/services/data/v25.0/sobjects/Account/";


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

            //add token to header
            request1.Headers.Add("Authorization", "Bearer " + oauthToken);
          
            //return xml to the caller
            request1.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
            request1.Content = updatecontent;
        
            HttpResponseMessage response1 = await updateclient.PutAsync(updateurl+"001O000000MPrtsIAD",request1.Content);

            string resultipp = await response1.Content.ReadAsStringAsync();
           

            Response.Write(resultipp);

            return resultipp;
I got this error "[{\"message\":\"Session expired or invalid\",\"errorCode\":\"INVALID_SESSION_ID\"} .
If any one help me to resolve this.
Hi,

I have one currency column in MS Access.

I am fetching the value from database. But i didnt update in Salesforce.

How Can i do this?

updateacc.X1_month__c=Double.Parse(row["Month1"].ToString(),NumberStyles.Currency );

SaveResult[] saveResults = sfdcbind.update(new sObject[] { updateacc });