• Sean Fife 9
  • NEWBIE
  • 45 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 4
    Replies
I have this code (C#, .NET 4.5), which is pretty much the Salesforce sample: https://www.salesforce.com/developer/docs/api/Content/sforce_api_calls_queryall.htm
 
service.QueryOptionsValue = new QueryOptions();
service.QueryOptionsValue.batchSize = 500;
service.QueryOptionsValue.batchSizeSpecified = true;

QueryResult qr = service.queryAll(selectString);
The service variable is an SforceService object with Enterprise API version 33.0, and every time I run it, no matter what object I query, I always get 200 rows back and not 500.

Is there some setting you have to set elsewhere so it won't ignore the batch size?  Or is this just wrong?
We're going to be turning on delegated authentication soon, but this seems like it will create a problem. Namely, that users will be forced (by the power of us hub) to log in through the native Salesforce login page, but that won't work once we turn on delegated authentication. It will always give them the error that our sso service is down.  So, they'll have to navigate back to our login page, login, then go back to the power of us hub page to log in. Seems cumbersome.

Anyone solve this?  Does this make sense?
Ok, so we have an External Id field that's sets to unique case-insensitive, yet we have about 200 records with the same value. And it's either blank or null values repeated between records.  What gives? Is this expected behavior? My searches have turned up nothing on this.  Is this really, unique except...?
I've been trying to use the tooling api with no luck.  After I found this post (https://success.salesforce.com/issues_view?id=a1p30000000T2GcAAK ) I tried the work around, but it's not working for me.  I get "No operation available for request {urn:tooling.soap.sforce.com}create" on the code below.  Anyone know whta's wrong?

I'm using VS2013 Pro with C#.

here's my code:
sfdc.tooling.SforceServiceService tooling;
        sfdc.partner.SforceService partner;
        private void Form1_Load(object sender, EventArgs e)
        {
            if (Login())
            {
                string classBody = "public class Messages {\n"
                      + "public string SayHello() {\n"
                      + " return 'Hello';\n" + "}\n"
                      + "}";

                // create a new ApexClass object and set the body 
                sfdc.tooling.ApexClass apexClass = new sfdc.tooling.ApexClass();
                apexClass.Body = classBody;
                sfdc.tooling.ApexClass[] classes = new sfdc.tooling.ApexClass[]{ apexClass };

                // call create() to add the class
                sfdc.tooling.SaveResult[] saveResults = tooling.create(classes);//error here
                for (int i = 0; i < saveResults.Length; i++)
                {
                    if (saveResults[i].success)
                    {
                        Console.WriteLine("Successfully created Class: " +
                         saveResults[i].id);
                    }
                    else
                    {
                        Console.WriteLine("Error: could not create Class ");
                        Console.WriteLine("   The error reported was: " +
                        saveResults[i].errors[0].message + "\n");
                    }
                }

                tooling.logout();
            }
        }

        private bool Login()
        {
            bool success = false;
            try
            {
                tooling = new sfdc.tooling.SforceServiceService();
                partner = new sfdc.partner.SforceService();

                sfdc.partner.LoginResult lr;

                lr = partner.login(username, password + secretkey);
                success = true;

                string authEndPoint = tooling.Url;
                tooling.Url = lr.serverUrl;
                partner.Url = lr.serverUrl;

                tooling.SessionHeaderValue = new sfdc.tooling.SessionHeader();
                tooling.SessionHeaderValue.sessionId = lr.sessionId;
            }
            catch( SoapException e)
            {
                MessageBox.Show("Login failed: " + e.Message);
                //success = false;
            }

            return success;
        }

Thanks in advance.