• voztele_dev
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi, i have created a custom field in the opportunity entity, the field's type is multipicklist and i want to update it (in some cases) with no values (clear the list).

I am able to update it when there are values to put in, but when i try to update with an empty string the old values persist and nothing is updated.

Example:

...
key = "custom_field";
value = ...
MessageElement messageElement = new MessageElement(key, value);
opp[0] = new SObject();
opp[0].setType("Opportunity");
opp[0].set_any(messageElements);
...
SaveResult[] sr = binding.update(opp);

when value is something like "first;second;third" (values separated by semicolons) it works fine, but when value is an empty string (value = "";) it does not work.

Am i missing something ? is there any restriction ?
What is the way to clear a multipicklist of an object ?

Any help will be appreciated


Hi, i have created a custom field in the opportunity entity, the field's type is multipicklist and i want to update it (in some cases) with no values (clear the list).

I am able to update it when there are values to put in, but when i try to update with an empty string the old values persist and nothing is updated.

Example:

...
key = "custom_field";
value = ...
MessageElement messageElement = new MessageElement(key, value);
opp[0] = new SObject();
opp[0].setType("Opportunity");
opp[0].set_any(messageElements);
...
SaveResult[] sr = binding.update(opp);

when value is something like "first;second;third" (values separated by semicolons) it works fine, but when value is an empty string (value = "";) it does not work.

Am i missing something ? is there any restriction ?
What is the way to clear a multipicklist of an object ?

Any help will be appreciated