Quantcast
Viewing all articles
Browse latest Browse all 10280

Updating ServiceAppointment StateCode in C#

I'm trying to close out a ServiceAppointment in code. I can change the StatusCode but not the StateCode. I'm getting an error saying StatusCode100000010is not a valid code for an open ServiceAppointment. At the top of the code below are the two different ways that I've tried to set the StateCode. Neither one works.

retrievedSA.StateCode.Value = 1; retrievedSA.StatusCode.Value = 100000010; // OR retrievedSA.StateCode = new OptionSetValue() { Value = 1 }; retrievedSA.StatusCode = new OptionSetValue() { Value = 100000010 }; myContext.UpdateObject(retrievedSA);
myContext.BeginSaveChanges(OnRescheduledServiceAppointmentCompleted, retrievedSA);

I've seen the SetStateRequest code for the SDK but I am not using the SDK. I have a Service Reference inside Silverlight pointing to my OrganizationData.svc

How can I go about changing the StateCode to closed for this?




Viewing all articles
Browse latest Browse all 10280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>