In a recent (heavily customised) implementation of MSCRM for a call centre I have had the requirement to set the state of a Phonecall Activity to "Completed", depending certain actions by the user on the frontend.
MSCRM exposes itself via the "CrmWebservice"- and "MetadataService" web services. All the CRM entities, like Contact, Incident, etc. are extensions of the BusinessEntity base class, and so it is also for Activity, from which Phonecall derives.
Ussually when updating any BusinessEntity, I used the CrmService.Update(BusinessEntity) webmethod. This, however, does not work for updating the state (or status) on any type of activity - to do this you need to use the CrmService.Execute(CrmService.Request) webmethod, which returns a CrmService.Response.
This might seem unintuitive at first, though it is quite easy to use, as there are pre-defined classes deriving from Request and Response - one of these are SetStatePhoneCallRequest.
The state on a phonecall is updated as follows:
private void CloseCall(Guid callId)
{
using (CrmService svc =
ServiceFactory.GetWebService<CrmService>())
{
SetStatePhoneCallRequest request = new SetStatePhoneCallRequest();
request.EntityId = callId;
request.PhoneCallState
= PhoneCallState.Completed;
request.PhoneCallStatus = 2;
svc.Execute(request);
}
}
Examining the SetStatePhoneCallResponse being returned by Execute is not necessary, as it has no public fields. I am unsure why this specific property on a Phonecall can not be set using the Update webmethod (which works for all the other properties of a phonecall), however this is the correct way to do update status on *any* type of activity. (Note for example the SetStateQuoteRequest, SetStatePriceLevelRequest, etc. classes).
After adequate whining by the South African market, the XBOX360 is about to be launched in SA. One of the reasons that this hasn't happened before is that the SA market is considerably small compared to the US, European and Asian markets. The first 6 years of XBOX has been a solid loss to Microsoft (a $1.262 billion loss for the year ending in June 2006) with the goal of getting a foothold in a hard-to-penetrate market dominated by a few big boys. I think they have accomplished the foothold, but I am sure that revenue is now on top of their to-do list.
Read more here.
Just over two years ago I had a post titled "The home PC of 2006" - it's quite amazing to see how accurate especially the networking prediction was. 4-6GHz though? hmmmm....
It sadly amazes me to see that the prediction related to our government and internet connectivity has also been spot-on.
Apparently the time to update my blog is right here and now; here is a *brief* update: I am alive!
PS - I have been getting tangled with MS Dynamics CRM lately, and will post incredibly wisdom on the subject as soon as I get the time.