• BOFH
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I am attempting to extract roughtly 4246 records from SalesForce.  I know the limit on the batch size is only 2000, which is where my problem comes in.  I get it to run through the loop 4246 times, but I end up with exactly 2246 null records.  I am not sure what I am doing wrong.  I have gone through the message board, but haven't been able to find much help, and staring at the code isn't working too well either.  So if anyone has any suggestions, they would be appreciated.  Below is the code I am using.  Thanks.

            binding.QueryOptionsValue.batchSize = 2000;
            binding.QueryOptionsValue.batchSizeSpecified = true;
            qr = binding.query("Select Id, OpportunityId, PricebookEntryId, Quantity, Option_id__c " +
                                          " FROM OpportunityLineItem WHERE Option_id__c <= \'0\'");
            done = false;
            if (qr.size > 0)
            {
                initializeArrays(qr.size);
                while (!done)
                {
                    for (int i = 0; i < qr.records.Length; i++)
                    {
                            sObject rec = qr.records[i];
                            id[i] = getValue("Id", rec.Any);
                            opportunityId[i] = getValue("OpportunityId", rec.Any);
                            priceBookId[i] = getValue("PriceBookEntryId", rec.Any);
                            quantity[i] = getValue("Quantity", rec.Any);
                            optionId[i] = getValue("Option_id__c", rec.Any);
                    }
                    if (qr.done)
                        done = true;
                    else
                        qr = binding.queryMore(qr.queryLocator);
                }
              }

Let me know if you need any more information.  Thanks again.
  • July 10, 2007
  • Like
  • 0
Hi all--

I'm attempting to update the Account Number, and two custom fields under Accounts using the partner WSDL, C#.net, and the SOAP API.  Anytime I do multiple fields nothing happens, but the program returns success.  If I only do one field at a time, it updates that field without a problem and also returns success.  Does anyone have any insight as to why this is happening?  Does SalesForce only let you update one field at a time?

Thanks.
  • December 20, 2006
  • Like
  • 0
Hi all,

I'm new to developing with Sales Force, I just downloaded the Office Tool Kit, and am attempting to run a simple query that should return one record.  I know the record exists, and I know the query is working, since when I run the code, it tells me I am getting one result back.  Here is the C# code that I am running:
                   
                    strSOQL = "Select Name FROM Account where accountnumber = 'xxxxx'";  //Where xxxxx is an account number
                    sfQry = sfObj.Query(strSOQL, sync);
                   
                    //result testing
                    rslt = sfQry.Error.ToString();
                    Console.WriteLine("Error (if any): " + rslt);
                    Console.WriteLine("Result:");
                    count = sfQry.Size;
                    Console.WriteLine("Count: " + count);
                    rslt = sfQry.EntityType;
                    Console.WriteLine("Entity Type: " + rslt);
                    foreach (object obj in sfQry)
                    {
                        result = sfQry.ToString();
                        Console.WriteLine("Query Result: " + result);
                    }

This compiles and runs, when I run it, I get the following result:

Successfully Logged In
Error (if any): NO_SF_ERROR
Result:
Count: 1
Entity Type: account
Query Result: SForceOfficeToolkitLib3.QueryResultSet3Class
Press any key to exit...

I am wondering how to get the program to display the Name instead of printing out: SForceOfficeToolkitLib3.QueryResultSet3Class .

Any and all help is appreciated.

Thanks.
  • December 06, 2006
  • Like
  • 0
I am attempting to extract roughtly 4246 records from SalesForce.  I know the limit on the batch size is only 2000, which is where my problem comes in.  I get it to run through the loop 4246 times, but I end up with exactly 2246 null records.  I am not sure what I am doing wrong.  I have gone through the message board, but haven't been able to find much help, and staring at the code isn't working too well either.  So if anyone has any suggestions, they would be appreciated.  Below is the code I am using.  Thanks.

            binding.QueryOptionsValue.batchSize = 2000;
            binding.QueryOptionsValue.batchSizeSpecified = true;
            qr = binding.query("Select Id, OpportunityId, PricebookEntryId, Quantity, Option_id__c " +
                                          " FROM OpportunityLineItem WHERE Option_id__c <= \'0\'");
            done = false;
            if (qr.size > 0)
            {
                initializeArrays(qr.size);
                while (!done)
                {
                    for (int i = 0; i < qr.records.Length; i++)
                    {
                            sObject rec = qr.records[i];
                            id[i] = getValue("Id", rec.Any);
                            opportunityId[i] = getValue("OpportunityId", rec.Any);
                            priceBookId[i] = getValue("PriceBookEntryId", rec.Any);
                            quantity[i] = getValue("Quantity", rec.Any);
                            optionId[i] = getValue("Option_id__c", rec.Any);
                    }
                    if (qr.done)
                        done = true;
                    else
                        qr = binding.queryMore(qr.queryLocator);
                }
              }

Let me know if you need any more information.  Thanks again.
  • July 10, 2007
  • Like
  • 0
Hi all--

I'm attempting to update the Account Number, and two custom fields under Accounts using the partner WSDL, C#.net, and the SOAP API.  Anytime I do multiple fields nothing happens, but the program returns success.  If I only do one field at a time, it updates that field without a problem and also returns success.  Does anyone have any insight as to why this is happening?  Does SalesForce only let you update one field at a time?

Thanks.
  • December 20, 2006
  • Like
  • 0
Hi all,

I'm new to developing with Sales Force, I just downloaded the Office Tool Kit, and am attempting to run a simple query that should return one record.  I know the record exists, and I know the query is working, since when I run the code, it tells me I am getting one result back.  Here is the C# code that I am running:
                   
                    strSOQL = "Select Name FROM Account where accountnumber = 'xxxxx'";  //Where xxxxx is an account number
                    sfQry = sfObj.Query(strSOQL, sync);
                   
                    //result testing
                    rslt = sfQry.Error.ToString();
                    Console.WriteLine("Error (if any): " + rslt);
                    Console.WriteLine("Result:");
                    count = sfQry.Size;
                    Console.WriteLine("Count: " + count);
                    rslt = sfQry.EntityType;
                    Console.WriteLine("Entity Type: " + rslt);
                    foreach (object obj in sfQry)
                    {
                        result = sfQry.ToString();
                        Console.WriteLine("Query Result: " + result);
                    }

This compiles and runs, when I run it, I get the following result:

Successfully Logged In
Error (if any): NO_SF_ERROR
Result:
Count: 1
Entity Type: account
Query Result: SForceOfficeToolkitLib3.QueryResultSet3Class
Press any key to exit...

I am wondering how to get the program to display the Name instead of printing out: SForceOfficeToolkitLib3.QueryResultSet3Class .

Any and all help is appreciated.

Thanks.
  • December 06, 2006
  • Like
  • 0