Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unified Service Desk (USD) - get parameter values from url

Posted on by 68

Hi there USD people!

I'm currently buildig a USD solution for one of our customers. It is going well so far but there is one thing that I cannot seem to get right: parsing parameters from a url.

What I want to do:

I want the user to be able to select a CRM record from a list (a case from a list of cases from an associated view), and I want to store the id for that selected case in the session so that I associate the current activity with that case. 

What I tried to do:

I tried to create a window navigation rule, so that when a case is selected (either by clicking the link or doubleclicking the case), I can do a FetchXml based on the selected search. However, the action data that I get looks like this:  "url"="myorg.crm4.dynamics.com/main.aspx;extraqs=%3fetc%3d112%26id%3d%257bE08AF044-F9E9-E611-80F8-5065F38A4A21%257d&histKey=192025612&newWindow=true&pagetype=entityrecord".

I just want to parse the Id from this url. I know that it should be possible to do this, because when creating a new session for example, USD knows which Contact or Account I selected. I tried I lot of combinations to use as a replacement paramets ([[Id]], [[incident.Id]], etc. etc.).

I hope I explained myself clearly. Would really appreciate if someone knows the answer to this.

Have a nice day :)

*This post is locked for comments

  • Erik Donker Profile Picture
    Erik Donker 68 on at
    RE: Unified Service Desk (USD) - get parameter values from url

    Hi Srikanth, thanks a lot for your reply. I went with the solution suggested by Neil. I think that GetSelectedId's is meant for selected records, not records that you actually open. I have not managed to get it to work though, but I will notify you when I do.

  • Erik Donker Profile Picture
    Erik Donker 68 on at
    RE: Unified Service Desk (USD) - get parameter values from url

    Hi Neil, thanks a lot for your reply. The 'Route Window' option did the trick! Other settings I used were Route Type: Popup and Destination: Tab.

  • ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: Unified Service Desk (USD) - get parameter values from url

    [quote user="E. Light"]

    What I want to do:

    I want the user to be able to select a CRM record from a list (a case from a list of cases from an associated view), and I want to store the id for that selected case in the session so that I associate the current activity with that case. 

    [/quote]

    Hi, This is the solution you are trying for a particular "problem". If you can give the problem, maybe you can get better/alternate solutions.

    With the above-mentioned solution, I'm imagining you have already an activity which is opened as a tab in the USD and you want to associate one of the selected cases (the associated cases view opened in a different tab) to this activity? I don't really think you want your users to double click on the case to associate - do you? What happens if the user normally opened the case (not in the intention to associate)?

    I strongly believe that getSelectedIds action of USD CRM Page hosted control is the one you are looking for. But unfortunately, I'm unable to get the result of it. I'm looking for other alternate possibles of the situation. But If you can confirm my above understanding & provide the actual problem statement then probably I think I can help you out.

  • Verified answer
    Neil Parkhurst Profile Picture
    Neil Parkhurst 10,725 User Group Leader on at
    RE: Unified Service Desk (USD) - get parameter values from url

    Hi

    To parse the url you'd need to look into using a scriptlet. As then you could use some JavaScript to parse it and return just the ID. BUT ....

    I am not sure you should need to parse the url for what you are trying to achieve.

    When you open the case from a list, I assume you have a window navigation rule to govern how that incident loads. Be that a route window into the current session or a create session  if the case is the start point of your session.

    Regardless of which of these you are doing once the case has been loaded you should be able to see and use replacement parameters to get the ID and other attributes of the case. Try looking at the replacement parameters in the debugger. You should see them there. (In the debugger .... Don't forget to refresh the replacement parameters after the case has loaded!)

    You should see parameters like [[incident.Id]]

    Now when we use these on say an activity you need to consider if you are setting a lookup field, or party list etc. I have shown some example code based on contact and phonecall below. Hopefully you can see how to use EntityReference and PartyList

    LogicalName=phonecall

    subject=Call from : [[contact.fullname]]

    regardingobjectid=EntityReference(contact,[[contact.Id]])

    to=PartyList(er["systemuser",[[$User.systemuserid]+g]]) from=PartyList(er["contact",[[contact.Id]+]])

     

    You can find one example in my blog here;

    https://neilparkhurst.com/2016/04/19/usd-create-phone-call-saved/

    Along with many other examples;

    https://neilparkhurst.com/2016/06/20/usd-the-book/

    Hopefully this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans