2

When I am trying to update a list item, I get an error CopyFieldMask , Value does not fall within the expected range My code is as follows:

    SPQuery  oquery=new SPQuery();
    oquery.Query= "<Where><Eq><FieldRef Name='ID' /> <Value Type='Counter'>"+strid+"</Value></Eq></Where>";
oquery.ViewFields = "<FieldRef Name='ID' /><FieldRef Name='Status' />";
    SPListItemCollection collistitems= listPartner.GetItems(oquery);
    SPListItem newItem=collistitems[0];//i get error here saying CopyField mask throws Argument exception and value doesn't not fall within the expected range
    newItem["Status"]="Supplied";
    newItem.Update();//Exceptions occurs

I tried by changing the value in resource throttling from 12 to 15 although I am not using any Lookups I also tried using ViewFields in my CAML query and the Internal name of Status Column is same.

Please assist me with this.

0
  1. Did you try hard coding the value of strid and trying the same ? check if u still get the error? i.e replace "+strid+" by an id value from the list
  2. ensure the value passes is an integer
  • hi Polika, yes It is an integer value and also tried by hardcoding the value of strID, still no success. – Salim Mandrekar Mar 22 '17 at 5:11

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.