How to set the Opportunity Status - Dynamics CRM?

前端 未结 2 1036
我寻月下人不归
我寻月下人不归 2021-01-21 18:05

I\'m trying to update the status of open opportunity by using the WinOpportunityRequest & LoseOpportunityRequest API provided in the MSDN. I\'ve f

2条回答
  •  遇见更好的自我
    2021-01-21 18:24

    You are right. State & Status are conjoined twins. You cannot update only one of them, always go in pair.

    State = StateCode
    Status Reason = StatusCode (field with Padlock)

    More read

    In your answer code, this is framed correctly in SetStateRequest req.

    req.State = new OptionSetValue(0);
    req.Status = new OptionSetValue(2);
    

    But in OP, you set only Status not State.

    Per MSDN, LoseOpportunityRequest with OpportunityClose entity has to close it without issues when you pass only Status. But you are not alone.

    Ref: Opportunity & OpportunityClose

提交回复
热议问题