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.

2
  • 1
    What do you mean by "doesn't work"? Do you get an error? Jan 8, 2016 at 12:40
  • 1
    Check FLS for description in your SFDC instance? Jan 8, 2016 at 13:17

1 Answer 1

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.

2
  • 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, 2016 at 17:54
  • Also link only responses are brittle and frowned upon.
    – Adrian Larson
    Jan 10, 2016 at 23:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .