• alex.gan1.3933003770315437E12
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
I can't update a checkbox field(no error,but the checkbox field doesn't updated),code like this:

Account[] a= new Account[0];
a[0].Id = customer.Id;
a[0].Name = customer.Name;//textbox field is OK
a[0].Anyue_Membership__c = true;//checkbox field not be updated

            LimitInfo[] li;
            SaveResult[] sr;
            try
            {
                DebuggingInfo di = client.update(header, null, null, null, null, null, null, null, null, null, null, a, out li, out sr);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            if (sr[0].success == false)
            {
                foreach (Error error in sr[0].errors)
                {
                    returnValue += "errormessage:" + error.statusCode + error.message + "\t";
                }
            }
            return returnValue;

could anybody help me?
could anybody tell me where do they saved?
Thanks!
2 standard Object: Account and User

1. there's a customer field in Account : Public_Owner__c, it's a lookup field(User) 
2. there's a customer field in Account : isPublic(bool)
3. there's a rule in field Public_Owner : ((Public_Owner_r.LastName != null) && (isPublic=true) )
     error message is : "it's not allowed to check isPublic when Public_Owner is not null"
means: if Public_Owner == null then isPublic = true else isPublic = false;

my program(C#):
......
accounts[0].Id = id;
accounts[0].Public_Owner__c = userId
accounts[0].isPublic = (userId == null) ? true : false;

LimitInfo[] li;
SaveResult[] sr;
DebuggingInfo di = client.update(header, null, null, null, null, null, null, null, null, null, null, accounts, out li, out sr);
if (sr[0].success == false)
 {
      foreach (Error error in sr[0].errors)
            {
                returnValue += "errormessage:" + error.statusCode + error.message + "\t";
            }
}

here's the problem:
when I call update() to update the account,  if field isPublic is false,update() is OK,else there's always a error: FIELD_CUSTOM_VALIDATION_EXCEPTION and the rule error:"it's not allowed to check isPublic when Public_Owner is not null"

sorry for my poor english,could anybody help me?
Thanx!
I can't update a checkbox field(no error,but the checkbox field doesn't updated),code like this:

Account[] a= new Account[0];
a[0].Id = customer.Id;
a[0].Name = customer.Name;//textbox field is OK
a[0].Anyue_Membership__c = true;//checkbox field not be updated

            LimitInfo[] li;
            SaveResult[] sr;
            try
            {
                DebuggingInfo di = client.update(header, null, null, null, null, null, null, null, null, null, null, a, out li, out sr);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            if (sr[0].success == false)
            {
                foreach (Error error in sr[0].errors)
                {
                    returnValue += "errormessage:" + error.statusCode + error.message + "\t";
                }
            }
            return returnValue;

could anybody help me?
could anybody tell me where do they saved?
Thanks!
2 standard Object: Account and User

1. there's a customer field in Account : Public_Owner__c, it's a lookup field(User) 
2. there's a customer field in Account : isPublic(bool)
3. there's a rule in field Public_Owner : ((Public_Owner_r.LastName != null) && (isPublic=true) )
     error message is : "it's not allowed to check isPublic when Public_Owner is not null"
means: if Public_Owner == null then isPublic = true else isPublic = false;

my program(C#):
......
accounts[0].Id = id;
accounts[0].Public_Owner__c = userId
accounts[0].isPublic = (userId == null) ? true : false;

LimitInfo[] li;
SaveResult[] sr;
DebuggingInfo di = client.update(header, null, null, null, null, null, null, null, null, null, null, accounts, out li, out sr);
if (sr[0].success == false)
 {
      foreach (Error error in sr[0].errors)
            {
                returnValue += "errormessage:" + error.statusCode + error.message + "\t";
            }
}

here's the problem:
when I call update() to update the account,  if field isPublic is false,update() is OK,else there's always a error: FIELD_CUSTOM_VALIDATION_EXCEPTION and the rule error:"it's not allowed to check isPublic when Public_Owner is not null"

sorry for my poor english,could anybody help me?
Thanx!