Prevent closing lost Opportunities if Competitor is not added RRS feed

  • Question

  • Hi All,

    I was reading the CRM forums looking for the answer to my question above, but can't it.

    My issue is I would like to make competitor field business required when opportunity is lost.

    opportunity close is a system entity and not cutomizable.

    How would I do that? Can someone help me out with this?

    Thanks a lot for your help in advance

    Friday, October 1, 2010 8:39 PM


All replies

  • You will have to create a plugin that checks your condition and then prevents the opportunity from being saved.
    MSCRM Bing'd - http://bingsoft.wordpress.com

    Check out the CRM 4 to CRM 2011 JavaScript Converter Tool
    Friday, October 1, 2010 10:59 PM
  • Without specifically writing it for you I think the answer is a workflow. Although I could write it for you that goes beyond the nature of support in a group of this nature.

    You could write the work flow to be triggered on Opportunity Close to check for your condition and then change the status and reassign it to the person with an overdue status. Each time they try to close it without specificy the competitor it would repeat. Eventually their activities would be overloaded with opportunities which they had not specified a competitor. It is a simple check that gives them a change to research the competitor before specifying.

    I beleive this is the overview of the how and answers your question.

    Saturday, October 2, 2010 12:03 AM
  • Hi,

    You can check your condition by calling MS CRM Web Services using Javascript.

    MS CRM provides a vry good feature of calling MS CRM Web Services using Javascript. On the form load you have to call the Javascript Web Services to Query the desired entity from where you want to fetch the details. It returns the XML with the Entity details. Retrieve the details and pre populate the Order Form attributes with the result.

    So, you have to work with Client Side Web Services - MS CRM

    Please refer below link - how to work with client side web services with MS CRM.

    And here is the tool which generates the Javascript Code (very helpful):

    Hope this helps.

    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    • Proposed as answer by Ranjitsingh R Saturday, October 2, 2010 4:41 AM
    • Marked as answer by Jim Glass Jr Saturday, October 2, 2010 8:57 PM
    Saturday, October 2, 2010 4:40 AM
  • I am new to CRM and don't know how to write plug-in.

    Is there any sample plug-in that I can use for this?

    Saturday, October 2, 2010 3:39 PM
  • Hi Ranjit,

    I started using CRM recently and not familiar with MS CRM Web service.

    Is there any other way we can achieve this?

    Thanks a lot for your help


    Saturday, October 2, 2010 3:43 PM
  • Sunday, October 3, 2010 9:01 AM
  • Thank you so much Andriy

    It is greatly appreciated, I will try this out and let you know the result

    Monday, October 4, 2010 4:39 PM
  • Thanks a lot Andriy. You are great.

    Your code works perfectle fine for what I was looking.

    Thank you so much for your willingness to help others.

    GOD bless you.

    Tuesday, October 5, 2010 2:54 PM
  • Hi Andriy,

    My company now has different requirements. They would like to make competitor field mandatory for won opportunities as well.

    Currently it is only enabled when we click on lost for status. Is there a way we can enabled competitior for won opportunities when closing the opportunities?

    Thanks you so much for your help, it is greatly appreciated


    Tuesday, October 5, 2010 8:35 PM
  • Tuesday, October 5, 2010 8:40 PM
  • Thank you so much sending this code. Being new to CRM it looks quite complicated to me.

    Where do I apply this code?

    Wednesday, October 6, 2010 2:06 AM
  • You should modify page code how I described it in article.
    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Wednesday, October 6, 2010 7:01 AM