Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Option Set for States with OOB Functionality

  • 1.  Option Set for States with OOB Functionality

    Posted 05-09-2018 06:28 PM
    Hello,

    In our CRM environment (Dynamics 2013) we currently use a custom field connected to a global option set for state.  This makes sure we have consistent information in the state field and users cannot type in random values into the OOB(out-of-box) state field.  We like this and are not looking to change it.  The downside of using this custom field is the map will not load on our Accounts, Contacts, and Leads because the OOB state field is blank.

    Has anyone had to deal with this before?  Any clever work around?  I located this article from Power Objects written in 2012 and I'm considering doing the solution copied below.

    Adding a State or a Province Field that is a Dropdown or Lookup in CRM 2011 - Microsoft Dynamics CRM Community
    You can alternatively use workflow to populate the out of the box field state/province field. This is a fairly simple workflow, but must be recreated for each entity where you use the new state/province field. Due to the way workflows run, it may take a few seconds for the state to populate the out of the box field.


    ------------------------------
    Patryk Malesa
    Beacon Funding Corporation
    Northbrook IL
    ------------------------------


  • 2.  RE: Option Set for States with OOB Functionality

    GOLD CONTRIBUTOR
    Posted 05-10-2018 04:14 AM
    Patryk, the PowerObjects neatly sums up the choices. I've done similar things using workflow and JavaScript. I guess workflow is better because the OOB field gets updated regardless of how data is added to Dynamics (via form, import or programmatically).

    If you add the workflow to Accounts, Contacts and Leads note that you might end up performing redundant updates.For example, user enters a lead, the workflow runs to update the OOB state. Then the lead is qualified to create an account and contact.

    If you have workflows on account and contact, they will run again to update the OOB state. You might add a test in the workflow to not run if the OOB state is already populated.

    Also, you need to deal with change of address, so that if someone changes the state, the OOB state is changed -  the workflow will need a trigger on change of your custom state field.

    If it is important that the OOB state is updated straightaway before the user can do anything else you could make the workflow synchronous - but I don't see that this would be needed.

    ------------------------------
    Feridun Kadir
    Principal Consultant, MVP
    Expert CRM Services Ltd
    Stansted
    ------------------------------



  • 3.  RE: Option Set for States with OOB Functionality

    Posted 05-10-2018 08:45 AM
    Thank you Feridun.  You made some great points there that I will keep in mind when creating the workflow.

    ------------------------------
    Patryk Malesa
    Beacon Funding Corporation
    Northbrook IL
    ------------------------------



  • 4.  RE: Option Set for States with OOB Functionality

    GOLD CONTRIBUTOR
    Posted 05-10-2018 04:22 AM
    We use entities for States (and Countries). It works well because well because we have it set up so users can just enter the two digit state code (e.g CA) to populate the field.

    You could use a workflow to populate the State/Province text value and have the best of both worlds.

    ------------------------------
    Donal McCarthy
    BrightWork
    Galway
    ------------------------------



  • 5.  RE: Option Set for States with OOB Functionality

    Posted 05-10-2018 08:46 AM
    This is an interesting thought. While I don't think we want to stray away from our option set at this time, this is something I will keep in mind.

    ------------------------------
    Patryk Malesa
    Beacon Funding Corporation
    Northbrook IL
    ------------------------------



  • 6.  RE: Option Set for States with OOB Functionality

    GOLD CONTRIBUTOR
    Posted 05-10-2018 04:23 AM
    Hi Patryk,

    The method suggested in the article sounds like the best way forward to me. You may want to consider locking down the OOTB state field if you haven't already, although I'm not sure that's straightforward with the composite address field. It's not a big deal, but it'll stop users populating the field with data that may be overwritten.

    Thanks,

    Tom

    ------------------------------
    Tom Pickles
    CRM Support Analyst
    Chess Digital
    Edinburgh SC
    ------------------------------



  • 7.  RE: Option Set for States with OOB Functionality

    Posted 05-10-2018 08:47 AM
    Thanks for the response.  We hid the field long ago so we should be covered there.

    ------------------------------
    Patryk Malesa
    Beacon Funding Corporation
    Northbrook IL
    ------------------------------



  • 8.  RE: Option Set for States with OOB Functionality

    SILVER CONTRIBUTOR
    Posted 05-10-2018 04:35 AM
    Hi Patryk

    I would say a Realtime or Background workflow on change of your custom State field would be the easiest way to go but there are some considerations you will want to take into account.

    Firstly, what do you want to do about all your Account, Contacts and Leads where this Custom State is already populated but the OOB State field is not? A realtime workflow will not pick these up automatically, there would need to be a change to the State field to trigger it (i wouldn't suggest triggering it off multiple fields) so will you run this on demand for all your records? As you can only run a workflow on 250 records at a time, this might be painstaking and also affect performance. If you aren't going to worry about existing ones, this is a fine solution.

    Secondly, If you want this on all records but don't want to run on demand workflows due to you having thousands of records, but want this to be updated on new and existing records; you could consider using Business Rules. Business Rules run on Form load, meaning if the criteria matches, the Rule will run. Any new records created will run this rule and any time anyone opens existing records, it would also run this rule, so you would be updating records as you go.The Rule would be something like the below.

    If Custom State Contains data
    Then Set OOB State to Custom State

    I haven't tested copying OptionSet labels to a text field but i don't see why that wouldn't work.

    ------------------------------
    Matt Collins
    CRM/D365 Consultant
    Technology Services Group
    Newcastle upon Tyne
    ------------------------------



  • 9.  RE: Option Set for States with OOB Functionality

    Posted 05-10-2018 08:48 AM
    You hit the nail on the head with this post.

    In order to fix all the currently open/active records we will run a scribe to update them.  We have way TOO MANY records to update 250 at a time!

    Thanks!

    ------------------------------
    Patryk Malesa
    Beacon Funding Corporation
    Northbrook IL
    ------------------------------



  • 10.  RE: Option Set for States with OOB Functionality

    GOLD CONTRIBUTOR
    Posted 05-10-2018 09:56 AM
    Actually, this is super simple with the XrmToolBox's Bulk Worfklow runner:

    Run On-Demand Workflows on bulk records using XrmToolBox - bulk workflow execution - Microsoft Dynamics CRM Community
    Dynamics remove preview
    Run On-Demand Workflows on bulk records using XrmToolBox - bulk workflow execution - Microsoft Dynamics CRM Community
    Microsoft Dynamics CRM On-Demand workflows are great and help in so many ways. you can easily run these on records such as 100 , 500, 1000 & may be on 2000? But wait... how about 10000 records? that's where it might become very hectic but with introduction of a new plugin/tool in XrmToolBox - it has become very easy.
    View this on Dynamics >

    Just filter it to records that don't have a text value.  Easy Peasy!

    ------------------------------
    Daryl LaBar
    Capability Manager, MVP
    PowerObjects - An HCL Technologies Company
    Fishers IN
    ------------------------------



  • 11.  RE: Option Set for States with OOB Functionality

    SILVER CONTRIBUTOR
    Posted 05-11-2018 11:07 AM
    Second D la B's comment. Also, he is a pro and knows his stuff.  Bulk Workflow Exceution plugin in XRMToolbox is a lifesaver. Have used it to clean up data for my organization in nearly every major schema change we've ever done.

    ------------------------------
    Ryan Perry
    Auric Solar
    West Valley City UT
    ------------------------------