0

Here BranchAdmin is person or group column and from the below code i want to remove the value BranchAdmin column when the username equals to branch admin name.

try
                         {
                             foreach (SPListItem item in branchList.Items)
                             {
                                 string strBranchAdmin = Convert.ToString(item["BranchAdmin"]);
                                 if (strBranchAdmin == Username)
                                 {
                                     item["BranchAdmin"] = string.Empty;
                                 }

                             }
                             branchList.Update();
                         }
                         catch (Exception ex)
                         {

                         }
  • The code is not removing BranchAdmin Values from branch list – sachin Sep 10 '15 at 15:11
0
SPFieldUserValue noUser = null;
item["BranchAdmin"] = noUser;

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.