The solution here would be to remove the references to those fields before doing the update. e.g.
bool check = (bool)job.Attributes["salesorderispricelocked"]; if (check) { if (job.Attributes.Contains("productid")) { job.Attributes.Remove("productid"); } if (job.Attributes.Contains("uomid")) { job.Attributes.Remove("uomid"); } if (job.Attributes.Contains("priceperunit_base")) { job.Attributes.Remove("priceperunit_base"); } if (job.Attributes.Contains("priceperunit")) { job.Attributes.Remove("priceperunit"); } service.Update(job); } else { service.Update(job); }
This would be the same for the invoice entity too
Thank u..It helped me a lot
ReplyDeletePlease could you tell me What The "job" represented?
ReplyDelete