Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Dynamic Status Reasons based on User

  • 1.  Dynamic Status Reasons based on User

    SILVER CONTRIBUTOR
    Posted Jan 08, 2020 01:29 PM
    All,

    I am trying to see what is possible around having a unique set of status reasons on the Opportunity entity based on the user interacting with the system.

    I know that with the new release we can customize the opportunity closure form to add custom fields so i started with that idea but ran into issues. Specifically I created a custom field also called "Status reason" with a unique option set list and was then going to write back to the native listing with JScript the value selected. This approach though has a lot of overhead to maintain if more options are needed later or adjusted.

    Is there an easier way to accomplish what i am trying to do or any other options that the community would recommend?

    Thanks for any guidance or assistance with this!

    *Also, i tried to search the discussion boards to make sure this wasn't a duplicate but had some issues navigating the search so i apologize if this is repetitive.

    ------------------------------
    Erik Seitz
    RJ Corman Railroad Group, LLC
    Nicholasville KY
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: Dynamic Status Reasons based on User

    GOLD CONTRIBUTOR
    Posted Jan 08, 2020 02:55 PM
    Hey Erik could you provide a bit more detail around the requirements? You said you would have status reasons around the user interacting with the system. Are these reasons specifically around an open opportunity and what interaction would dictate status reasons? And to clarify you would like to have these reasons separate from the obb status reason field on opportunities? Thanks and I look forward to your reply!

    ------------------------------
    Doug Apicella
    Solution Architect
    Hitachi Solutions America, Ltd.
    Greenville SC
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: Dynamic Status Reasons based on User

    SILVER CONTRIBUTOR
    Posted Jan 08, 2020 03:35 PM

    @Doug Apicella thanks for your reply! 

    So the objective i have been asked to perform is set a unique list of status reasons, specifically on "closed as lost" of an opportunity. We have 2 separate departments of sales who interact through the sales process very differently. With this, i have recently been implementing separate MDAs, forms and views to separate out the departments and have a unique experience to their way of sales. This has drastically helped them with their accuracy on sales tracking, however, one of the teams asked me if i can change the list of "Closed as Lost" Status reasons to match their reasons more accurately. Currently the list includes the majority of the other departments reasons. I know i can add more to the list, but they would live in the list together. So ultimately my goal here would be to have Department A​'s list and then Department B's list in the dropdown but not at the same time. 


    So above is the list in the system currently which works for Department A. 
    But what i want to do is essentially remove all of those options when Department B clicks "Close as Lost" and have a different set of options. 


    ------------------------------
    Erik Seitz
    RJ Corman Railroad Group, LLC
    Nicholasville KY
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 4.  RE: Dynamic Status Reasons based on User

    Posted Jan 09, 2020 06:09 AM
    Erik, from your description of the problem I suggest tweaking your labels a bit. Like for Team A, have the labels such as A.Option 1, A.Option 2, A.Option 3.... similarly for Team B, have the labels such as B.Option 1, B.Option 2... If you're not ok with changing the labels, you can probably change the values.  Like for team 1 have a certain set of values for the options like say 906120001,906120002 and so on. For Team 2, have the values like 906120800,906120801 and so on. Once you're done with that, write a bit of Java script to remove options based on your needs.
    https://pravinpawarweb.wordpress.com/2019/07/11/retrieve-option-set-values-and-labels-without-use-of-metadata-request-in-plugin-and-javascript/
    Hope this helps. Good luck!

    ------------------------------
    Nikhil Rajendran
    Microsoft Dynamics CRM Developer
    Aha Apps
    Glen Allen VA
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 5.  RE: Dynamic Status Reasons based on User

    GOLD CONTRIBUTOR
    Posted Jan 09, 2020 08:53 AM
    Hey Erik,

    Nikhil is correct in that you can use JavaScript to hide options. You have some flexibility with it as well as you can filter potentially based on security role if the departments have different roles or you could filter based on the team they are a part of as well. As you mentioned now that we have the custom opportunity close dialogue there is a lot more flexibility. I think you can leave the labels as you'd like to provide a clean experience for your users. Thanks!

    ------------------------------
    Doug Apicella
    Solution Architect
    Hitachi Solutions America, Ltd.
    Greenville SC
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 6.  RE: Dynamic Status Reasons based on User

    SILVER CONTRIBUTOR
    Posted Jan 09, 2020 10:16 AM
    @Doug Apicella @Nikhil Rajendran Thanks for the feedback! I knew i could do it with JScript i just was hoping there was a method with less overhead to maintain. I hate hardcoding values into my JScript in preparation that they system is every evolving.  ​​But to accomplish this i will probably have to use that solution to achieve what they want. Thanks so much!!

    ------------------------------
    Erik Seitz
    RJ Corman Railroad Group, LLC
    Nicholasville KY
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 7.  RE: Dynamic Status Reasons based on User

    Posted Jan 09, 2020 10:32 AM
    Erik, you don't need to hard code like completely. That is why I suggested grouping your labels or values. You can write a couple of if else blocks. The way I was envisioning the solution to your problem is something like:
    if(Team A)
    {
     if(option set value < 906120020)
     display value
    else
    do not display.
    }
    else
    {
     if (option set value > 906120799)
     display value
    else
    do not display
    }
     Unfortunately you'll need to hard code one value here at least. I don't think that should be an issue? You can continue adding more options to the option set and give the value based on which team it needs to belong to. You wouldn't need to touch the JavaScript code again once you did that.

    ------------------------------
    Nikhil Rajendran
    Microsoft Dynamics CRM Developer
    Aha Apps
    Glen Allen VA
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 8.  RE: Dynamic Status Reasons based on User

    SILVER CONTRIBUTOR
    Posted Jan 09, 2020 10:44 AM
    @Nikhil Rajendran That makes sense, i like the approach with the values being above or below a set value. In theory you could add as many as you want as long as they are under or over that number and aren't equal. Very creative! Thanks much!  ​

    ------------------------------
    Erik Seitz
    RJ Corman Railroad Group, LLC
    Nicholasville KY
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 9.  RE: Dynamic Status Reasons based on User

    Posted Jan 09, 2020 02:03 PM
    Edited by Scott Florance Jan 09, 2020 02:05 PM
    Hi Erik,

    I really like what Nikhil suggested but there is another way that will do it without hard-coding but more fields:

    1. Add all of your options to the OOB Status Reason field.

    2. Create 2 custom Status Reason fields, each with the options for your two departments respectively. The key here is to match the values of each option in your custom lists to the value for the corresponding option in the OOB Status Reason.

    3. Hide the OOB Status Reason field on the Opp Close form and via jscript hide/show your two custom fields based on the Department.

    4. Have a jscript populate the OOB Status Reason with what is selected in either of the custom fields.

    This will prevent you from having to hard code the values in your jscript as the value is the same for both lists and your script is just passing through your variable. The only thing is that you would have to maintain the option sets and prevent them from getting out of sync but at least it prevents hard-coding.

    ------------------------------
    Scott Florance
    Business Applications Consultant
    KTL Solutions, Inc, Frederick MD
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role