Hello!
Now there is in the CRM API to work with a SLA and SLA - elements, so we had to create the amount of code maintenance, knit him SLA, SLA to create SLA elements to each element one by one workflow.
Everything is fine, everything works. The problem is that when activated via an SLA object CRM, an internal mechanism created 2 workflow, within which to XML itself contains information about all child workflow (related elemetrami SLA), etc.
If you activate the SLA programmatically (SetStateRequest) - error occurs - InvalidCastException - it is not clear where and what ... If you create a workflow and SLA kodom- everything works fine ... but do not want to do that, because it is a wild unsupport , and the body of the XML it is quite difficult
Can somebody faced a similar problem, or tell in which direction to look?