Skip to main content

Notifications

Dynamics 365 Community / Forums / Sales forum / Making specific fields...
Sales forum
Suggested answer

Making specific fields required when an opportunity is closed as won

Posted on by
In Dynamics CRM, I have a field on the Opportunity form that I would like to make mandatory when the opportunity is closed as won. I have created a business rule for that field that states when Status = Won, then the field is Business Required. However, it only works if I close the opportunity as won, reopen it and then try to close it as won again. Is there a way to make a field mandatory in order to close the opportunity as won in the first place? Thank you. 
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Making specific fields required when an opportunity is closed as won
    Hi Partner,
    Through my test, real-time workflow can achieve it easily:
    Go to Settings > Process.
    1)Create one workflow on the opportunity entity:
    2)Set trigger
    3)Add steps:
    --Condition:
    --Stop workflow:
    Test Result:

    I hope you can mark my answer verified if it is helpful! If you have any questions, please feel free to contact me.
    Regards,
    Leah
  • Inogic Profile Picture
    Inogic 24,003 on at
    Making specific fields required when an opportunity is closed as won
    Hi,
     
    You can ensure the opportunity is not closed as won till value is entered in your field you want to make mandatory. You can achieve this using OOB Sync workflow.
     
    Create one workflow which will get triggered when there is a change in status. As you have to make it run only when the status is won we will check whether the Status is Won or not. Then we will check whether the field that you have to make mandatory contains data or not. If it contains the data then the Opportunity will get closed otherwise it will give an error message and would restrict closing the opportunity as won.
     
    If this helped, kindly please mark this answer as verified as it will help others too who might have same query as yours.
     
    Thanks!
    Inogic Professional Services
    An expert technical extension for your techno-functional business needs
    Power Platform/Dynamics 365 CRM
    Drop an email at crm@inogic.com
    Service:  http://www.inogic.com/services/  
    Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/
  • TJardim Profile Picture
    TJardim 46 on at
    Making specific fields required when an opportunity is closed as won
    Hi Nancy,

    To address your issue in Dynamics CRM regarding making a specific field mandatory when an opportunity is closed as won, I believe you could use a combination of business rules and JavaScript.

    Since Dynamics CRM Business Rules don't trigger during the 'Close as Won' event, you'll need to implement JavaScript to enforce this validation upon closing the opportunity. Here's a step-by-step approach:

    1. JavaScript Event Handler: Create a JavaScript function that will be triggered when the 'Close as Won' event is initiated. This function should check if the specific field is filled out. If not, it should prevent the opportunity from being closed and prompt the user to fill in the required field.
    2. Register the Event Handler: You need to register this JavaScript function on the 'OnSave' event of the Opportunity form. Make sure to set it to trigger when the form is being saved during the 'Close as Won' process.
    3. Handling Other Scenarios: Ensure that this validation does not interfere with other stages of the opportunity lifecycle. The JavaScript should only enforce the field requirement when the status is being changed to 'Won'.
    4. Testing: Thoroughly test this solution in a non-production environment first to ensure it behaves as expected. Check for any edge cases or scenarios where the behavior might not be appropriate.
    5. Deployment: Once you're satisfied with the testing, deploy the JavaScript to your production environment.

    Here's a basic outline of what the JavaScript function might look like:

    Replace [Status Value for Won] and [Your Required Field] with the appropriate field names and status values from your Dynamics CRM setup.

    This approach ensures that the field is filled out before the opportunity can be closed as won, thus aligning with your business process requirements.

    I hope this was helpful.

    Kind regards,
    Tanisha Jardim
    Connecting Software

  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Making specific fields required when an opportunity is closed as won
    Hi Partner,
    It's hard to do, because the rule is that the later action is triggered when the state changes to 'won'.
    What you need is that making the field required before opportunity status changed to 'won'.
    Considering a plugin?

    I hope you can mark my answer verified if it is helpful! If you have any questions, please feel free to contact me.
    Regards,
    Leah

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans