I am having some difficulty inserting a row into a custom object. I am writing a java application that will insert rows into a custom salesforce object. There is no exception that is thrown, so I don't understand what I am missing. I can retrieve data, but the write does nothing.

here is a code snippet from my program

    Licence__c license = new Licence__c();
SaveResult[] result = conn.create(new SObject[] { license });

result returns with one entry, but the value of result[0].getId(); returns null

Any clues as to what I might be missing. I don't think it is a permissions issue, because I am able to create license object through saleforce using the same credentials.

I would really appreciate some clues as to what I might be doing wrong.

Thank you.

  • 2
    are you checking if the create was successful? E.g. result[0].isSuccess(). In case it's not, then getId() will be null and getErrors() will get you the error. – Guy Clairbois Mar 27 '16 at 22:00
  • thank for the hit Guy. That helped me take care of my issue. – Poorav Mar 28 '16 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.