State code or status code is invalid error in CRM 2011

Respondida State code or status code is invalid error in CRM 2011

  • Wednesday, May 02, 2012 9:31 PM
     
     

    I am trying to convert a Lead to a Contact, Account, and Opportunity on our internal CRM system by clicking the Qualify button in the ribbon on Lead.  It throws the below error:


    I click Download Log file and receive the message below:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: 9 is not a valid status code on opportunity.Detail: 
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147187704</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>9 is not a valid status code on opportunity.</Message>
      <Timestamp>2012-05-02T20:19:50.1980513Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </OrganizationServiceFault>

    I am assuming that once Qualify is clicked, it is trying to set the status code value of the newly-created Opportunity to 9, but since 9 isn't an option, it errors out.  I have checked everywhere (JScript, Ribbon XML, etc.) to determine where this is occurring, but I can't find it does anyone know how I can fix this problem?  Thank you for your help!


    • Edited by wikky2007 Tuesday, February 26, 2013 5:01 PM confidentiality
    •  

All Replies

  • Wednesday, May 02, 2012 9:49 PM
     
     
    Please check your lead entity filed of status code.
    Does any one enters any value in status code? like below

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
    Mubasher Sharif
    Check out my about.me profile!
    http://mubashersharif.blogspot.com
    Linked-In Profile
    Follow me on Twitter!

  • Wednesday, May 02, 2012 9:59 PM
     
     

    Yes, here is what I see:

    'Suspect' has a value of 9
    • Edited by wikky2007 Wednesday, May 02, 2012 10:00 PM
    •  
  • Thursday, May 03, 2012 12:00 PM
     
     Answered
    Make these options also available in opportunity status code.
    And also make sure that there values must be same as on leads

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
    Mubasher Sharif
    Check out my about.me profile!
    http://mubashersharif.blogspot.com
    Linked-In Profile
    Follow me on Twitter!

    • Marked As Answer by wikky2007 Monday, May 07, 2012 1:58 PM
    •  
  • Thursday, May 03, 2012 12:28 PM
     
     
    Suspect has a value of 9 though.  I can't set the values for new options; the system generates the value and the field is read-only.  How can I set the values on Opportunity to be the same?
  • Friday, May 04, 2012 10:13 PM
     
     
    Delete the values from both entities are again enter them and make sure this time the values should be same on both entities

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
    Mubasher Sharif
    Check out my about.me profile!
    http://mubashersharif.blogspot.com
    Linked-In Profile
    Follow me on Twitter!

  • Saturday, May 05, 2012 9:34 AM
     
     

    Remove Status Reason from the Lead to Opportunity mapping. (Settings -> Customizations -> Customize the System -> Entities -> Lead -> 1:N Relationships -> opportunity_originating_lead -> Mappings -> Remove Status Reason)

    Or if you require the Status Reason to be transferred to the Opportunity on converting then the values must match.

    Hope that helps!

    -Paul

  • Thursday, December 06, 2012 9:18 AM
     
     

    Remove Status Reason from the Lead to Opportunity mapping. (Settings -> Customizations -> Customize the System -> Entities -> Lead -> 1:N Relationships -> opportunity_originating_lead -> Mappings -> Remove Status Reason)

    Or if you require the Status Reason to be transferred to the Opportunity on converting then the values must match.

    Hope that helps!

    -Paul

    Hi.. i'm having the same issue with account. if I remove the "Status Reason " maping  form 1:N relationship will it affect any other default process ?!! I don't remember creating this maping in the first place.  is it the default mapping ?!!