0

I made a small Java Project to connect to Salesforce and get Leads and Create some new. Got into a problem of creating a new Lead with the "description" property even if i saw the property exists in the Lead Object. I don't understand this, really. Am i missing something?

This works:

JSONObject lead = new JSONObject();
        lead.put("FirstName", "Mike");
        lead.put("LastName", "Smith");
        lead.put("Company", "test.com");

This does not work:

JSONObject lead = new JSONObject();
        lead.put("FirstName", "Mike");
        lead.put("LastName", "Smith");
        lead.put("Company", "test.com");
        lead.put("Description", "random text here");

This is what i can see on debug:

[DEBUG] 55:03(Wire.java:wire:72)
http-outgoing-1 << "  "message" : "No such column 'Description' on sobject of type Lead",[\n]"

[DEBUG] 55:03(Wire.java:wire:72)
http-outgoing-1 << "  "errorCode" : "INVALID_FIELD"[\n]"

But i looked in the Lead object properties. It's there.

Thanks.

  • 1
    What do you mean by "doesn't work"? Do you get an error? – rael_kid Jan 8 '16 at 12:40
  • 1
    Check FLS for description in your SFDC instance? – Mohith Shrivastava Jan 8 '16 at 13:17
0

I googled it more and finally found an explanation. I cannot add a Description to a view because it's limit length is too long. Ugh. Not cool.

| improve this answer | |
  • 1
    ? this answer doesn't seem related to the OP's question that is about inserting a Lead record with a value for Description field. – cropredy Jan 8 '16 at 17:54
  • Also link only responses are brittle and frowned upon. – Adrian Larson Jan 10 '16 at 23:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.