Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

can XRMTool box be used for this scenario- need help!

  • 1.  can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 28 days ago
    I know XRM Toolbox can be used to auto generate #s but I have a user who needs the following to generate (transferring his stuff from TrackOps to CRM) so his standard projects pull in like this ex: B1903477EP . the B stands for Brazil. the 190 stands for the year the other 4 numbers would need to generate in chronological order, and the EP would also change based on the type of job performed. so it could be EP, SD, TR, IN, CO, GP, SA... there are about 10 or so options.

    Is this possible to generate something based on pulling in the field type? ​I've only had to use XRM toolbox to autogenerate project numbers but it was a simple formula of XXX-1234 this situation has many moving parts.

    thanks!

    ------------------------------
    Heather L
    ------------------------------
    Conference-CRMUG_200x200


  • 2.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 28 days ago
    My approach would be to set up individual fields for each of those items, (including the sequential numbers), then use a workflow to concatenate all the elements into a single field.

    ------------------------------
    If this answered your question, please click on the arrow button next to Reply Inline and choose 'Make Best Answer.'
    Thanks.
    Nelson Johnson, Solution Architect
    BroadPoint, Inc., Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------

    Conference-CRMUG_200x200


  • 3.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 28 days ago
    that sounds complicated! :)

    Currently, I set up the case type (the EP, SA, GP etc) as a drop down box. so that wouldn't work if I tried your route then?

    ------------------------------
    Heather L
    ------------------------------

    Conference-CRMUG_200x200


  • 4.  RE: can XRMTool box be used for this scenario- need help!

    Posted 27 days ago
    Hi Heather,

    The route Nelson suggested will works if you get the label of the option set you want. If I'm not wrong, the drop down you created for EP, SA and GP are multiple option set. These option set has values and labels. When you try to read the value it will get OptionSetValue. you can use Custom workflow/JavaScript  to concatenate and update the field based on your need. All you need to do is get option set label based on option set value and concatenate it.

    Thanks

    ------------------------------
    Ram Kiran Yarramasu
    Aha Apps
    Glen Allen VA
    ------------------------------

    Conference-CRMUG_200x200


  • 5.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 27 days ago
    Yes, it would work easily. here is what you should do
    • Create a field for the Year+sequential ID using XRMtoolbox to generate the numbers, for example using this as the format: {DATETIMEUTC:yy}0{SEQNUM:4} will generate the type of number you requested above such as "1901234" - see https://jonasr.app/2017/10/anm/ for details
    • setup a field for the country (your example was B for Brazil) which could be an option set or text field
    • you already have a regular option set for type of job performed
    • create a workflow to trigger when the sequential ID field (you created above) is modified
      • update record
        • in the Name field, you can insert all 3 of the above fields in the order you want {country}{number}{job type}
    Does that help?

    ------------------------------
    If this answered your question, please click on the arrow button next to Reply Inline and choose 'Make Best Answer.'
    Thanks.
    Nelson Johnson, Solution Architect
    BroadPoint, Inc., Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------

    Conference-CRMUG_200x200


  • 6.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 27 days ago
    Thanks @Nelson Johnson I sent you a PM. I will try to figure this out with your advice above!


    ------------------------------
    Heather L
    ------------------------------

    Conference-CRMUG_200x200


  • 7.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 28 days ago
    Heather

    This is a simple js code that "sorta" meets the requirements. It is unique by the second. You can then attach this code whenever the country or job gets change and update the "auto generated" field.

    const autoGenerate = (country, year, job) => {
      const startDate = new Date(year, 0, 1),
            diffDate =  Math.round((Date.now() - startDate) / 1000);
      
      return `${country.substring(0,1)}${diffDate}${job}`
    }




    ------------------------------
    Rex Kenley Tan, MCSA, MCSD
    Tallmadge OH
    https://www.youracclaim.com/users/rex-kenley-tan

    *Always be CURRENT with JavaScript & C#, NEVER be obsolete.

    DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
    ------------------------------

    Conference-CRMUG_200x200


  • 8.  RE: can XRMTool box be used for this scenario- need help!

    MICROSOFT MVP
    Posted 27 days ago
    Hi @Heather Laughlin

    The Auto Number Manager tool in XrmToolBox cannot compose this type of complex numbers. Or more correctly - the Auto Number feature in the CDS platform does not support it, and my tool only does what the platform supports.
    You can read more about the tool and its capabilities here: https://jonasr.app/tag/ANM/
    My guess is third party offers like North52 can accomplish what you are looking for.
    The idea from @Nelson Johnson is also viable if you don't want to write code for it.

    Jonas

    ------------------------------
    Jonas Rapp
    MVP
    Sweden
    ------------------------------

    Conference-CRMUG_200x200


  • 9.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 27 days ago
    @Jonas Thank you!! I was under the impression his request was a little too far out of the box for that to work, but glad you confirmed it. As far as the other options above - will those ideas still work?

    I need to have this completed by next week so trying to figure out my best option to move forward. I have no experience with programming or java script so I really want to understand the best way to move forward if possible.




    ------------------------------
    Heather L
    ------------------------------

    Conference-CRMUG_200x200


  • 10.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 27 days ago
    ok in reading I see that Multi Option set cannot be used in a workflow? Am I misunderstanding? I am fine with using regular option set if needed- just want to make sure before I set it up incorrectly. This field will be pulled in for a workflow and to use as part of a # that needs to be autogenerated based on the service provided. But they can only select 1 service at a time.


    ------------------------------
    Heather L
    ------------------------------

    Conference-CRMUG_200x200


  • 11.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 26 days ago
    You are right that multi-select option sets cannot be used in an update step, and I think you will be better off using a regular option set, based on what you explained in your original question. The reason I say that is because if you use a multi-select option set, and the user selects all options, I suspect that you would not want the number generated to be B1903477EPSDTRINCOGPSA, correct?

    ------------------------------
    If this answered your question, please click on the arrow button next to Reply Inline and choose 'Make Best Answer.'
    Thanks.
    Nelson Johnson, Solution Architect
    BroadPoint, Inc., Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------

    Conference-CRMUG_200x200


  • 12.  RE: can XRMTool box be used for this scenario- need help!

    TOP CONTRIBUTOR
    Posted 26 days ago
    Thanks for clarifying! Yes, I am going to stick with the original option set. I appreciate everyone's help! Although, the multi options set does look cool, its disappointing you can't use it in workflows so it hinders so much of its ability to be used!

    ------------------------------
    Heather L
    ------------------------------

    Conference-CRMUG_200x200


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