You need to sign in to do that
Don't have an account?
samson
Help! Weird update problem. Please advise!
I want to update a customized field of Case. (IsCommentMigrated is a checkbox field whose default value is "false".)
Following is the code:
*********************Section one ****************************
Case newCase = new Case();
newCase.Id = "XXXXXXXXXXX";
newCase.IsCommentMigrated__c = false;
newCase.IsCommentMigrated__cSpecified = false;
try
{
SaveResult[] srArray1 = binding.update(new sObject[] { newCase });
}
newCase.Id = "XXXXXXXXXXX";
newCase.IsCommentMigrated__c = false;
newCase.IsCommentMigrated__cSpecified = false;
try
{
SaveResult[] srArray1 = binding.update(new sObject[] { newCase });
}
*********************Section two****************************
Case newCase = new Case();
newCase.Id = "XXXXXXXXXXX";
newCase.IsCommentMigrated__c = true;
newCase.IsCommentMigrated__cSpecified = true;
try
{
SaveResult[] srArray1 = binding.update(new sObject[] { newCase });
}
newCase.Id = "XXXXXXXXXXX";
newCase.IsCommentMigrated__c = true;
newCase.IsCommentMigrated__cSpecified = true;
try
{
SaveResult[] srArray1 = binding.update(new sObject[] { newCase });
}
Section one failed, but Section two works! Any one have idea on that? Please advise,thanks!
Superfell
setting the xxSpecified flag to false means its not sent over the wire, therefore the salesforce server never sees that you want to change that xx value. You should always set the Specified flag to true, regardless of the value you are trying to set the actual field to.
samson
Thanks a million! It works!