Updating an expired Contract entity to draft in Microsoft Dynamics Crm
Hi I have been working on updating expired contracts in Microsoft Dynamics Crm 4.0. So that they change state to Draft and has an expired date in the future set. I have been doing this through the CrmWebservice.
My first try was to simply update through the Update method. But got this "The state is invalid, this contract cannot be updated".
So after that I have tried to update the status of the contract this way
SetStateContractRequest request = new SetStateContractRequest();
request.ContractState = ContractState.Draft;
request.ContractStatus = 1;
request.EntityId = contract.contractid.Value;
service.Execute(request);
Resulting in: "The target state is invalid. The target state may not exist or the system does not allow changing to the target state from the current state."
I've tried other combinations with the same result.
So I'm fearing that it's not possible to change the status of a Contract once it has expired. Is that the case? And if not, then h开发者_StackOverflow中文版ow do I solve the problem?
SetStateContractRequest should be the correct way, but according to a co-worker, this transition is not possible.
The whole contract/product/price list part of MSCRM is pretty rigid and restrictive; we usually forgo it altogether because it dictates a process that's different from what our customers need. Most of our projects that need contracts or products have custom entities for that part, around which we build a process that caters to the customer's needs.
精彩评论