• Diego Nieto
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
Hi Every one. I'm working in an integration process that uses jsforce, Now I have to use connection.bulk to convert leads to opportunities. Anyone knows how to do that process?

Thanks
Hi everyone

i'm working on an integration process using jsforce and bulk load operation. I'm sending 257 records but they could be more later. I could send 20 records and it seems that it worked, but when I sent the complete Data I have the error "CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:LeadTrigger: System.LimitException: Too many future calls:"  wich is correct because I'm using a trigger that calls an API from one of our providers. The option that i had was to send from 20 to 20 till end the Data records. I tried like this
 
var maxLeadNumber = getLength(newLeadList);
        var mod = maxLeadNumber % config.leadSendSize();

        var numberOfSend = ((maxLeadNumber - mod)/config.leadSendSize())+1;
        var recordsCounter = 0;
        for(var i = 0;i<numberOfSend;i++){
            conn.bulk.load('Lead','Insert',newLeadList.slice(recordsCounter,config.leadSendSize()),function(err,rets){
                if(err){return console.log(err);}

                for (var i=0; i < rets.length; i++) {
                    if (rets[i].success) {
                        console.log("#" + (recordsCounter + i+1) + " loaded successfully, id = " + rets[i].id);
                    } else {
                        console.log("#" + (recordsCounter + i+1) + " error occurred, message = " + rets[i].errors.join(', '));
                    }
                }

            });
            recordsCounter = recordsCounter + config.leadSendSize();
        }



and I had this error now 

{ ClientInputError: Unable to find any data to create batch
    at BulkApi.HttpApi.getError (D:\Zagalabs\Cipress Hill\SFIntegration\source\node_modules\jsforce\lib\http-api.js:250:13)
    at D:\Zagalabs\Cipress Hill\SFIntegration\source\node_modules\jsforce\lib\http-api.js:95:22
    at tryCallOne (D:\Zagalabs\Cipress Hill\SFIntegration\source\node_modules\promise\lib\core.js:37:12)
    at D:\Zagalabs\Cipress Hill\SFIntegration\source\node_modules\promise\lib\core.js:123:15
    at flush (D:\Zagalabs\Cipress Hill\SFIntegration\source\node_modules\asap\raw.js:50:29)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9) name: 'ClientInputError', errorCode: 'ClientInputError' }

may be i can be do wrong the send process. Can Anyone helpe with this please?
hello everyone

In my company we use an api to send Email to our clients. We need to create a trigger that send an email through this API and after that we need to create an Activity History record of Email type. 

when we use SigleEmailMessage it has the setSaveAsActivity flag, but we need to do it with ut use this class.

How I can do that?

Thank you
I am looking at the Tooling API for an example on how to create a class. I took a a look at this example and I suspect this documentation is outdated.

https://developer.salesforce.com/docs/atlas.en-us.198.0.api_tooling.meta/api_tooling/intro_soap_overview.htm

If you read the page it says "These Examples use java". This is incorrect. Console.WriteLine is not present in Java. It is a feature of C#.
When you attempt to compile this code, there are further errors.
 
String classBody = "public class Messages {\n"
   + "public string SayHello() {\n"
   + " return 'Hello';\n" + "}\n"
   + "}";

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

// call create() to add the class
SaveResult[] saveResults = sforce.create(classes);
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");
      }
   }

Is there a specific example on how to use tooling API?
 
Hello, 

I am using JSForce to try and authenticate with Salesforce and am receiving this error.

[Error: LOGIN_MUST_USE_SECURITY_TOKEN: Invalid username, password, security token; or user locked out. Are you at a new location? When accessing Salesforce--either via a desktop client or the API--from outside of your company’s trusted networks, you must add a security token to your password to log in. To receive a new security token, log in to salesforce.com at http://login.salesforce.com and click Setup | My Personal Information | Reset Security Token.]

I've tried adding the security token several ways: 
 
conn.login('usernamehere', 'passwordhere-securitytokenhere', function(err, res) {
 
conn.login('usernamehere', 'passwordheresecuritytokenhere', function(err, res) {

Does anyone know the proper way to pass the security token with the JSForce module (node, https://jsforce.github.io/)

Thanks!
Hi, Is there any way to convert many leads to accounts / opportunities at once using the Excel Connector?  Is there another appexchange product that does this?
Thanks,
Brian