web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Get parameters passed to a webresource using Xrm.Navigation.navigateTo

(0) ShareShare
ReportReport
Posted on by 505

Hi Experts,

I'm opening a web resource using Xrm.Navigation.navigateTo and passing some parameters to it.

Here is my code:

var pageInput = {
        pageType: "webresource",
        webresourceName: "wo_ProductGrid",
       data: encodeURIComponent(params)
    }; 

    var navigationOptions = {
        target: 2, // 2 is for opening the page as a dialog. 
        width: 1400, 
        height: 1000,  
        position: 1 // Specify 1 to open the dialog in center; 2 to open the dialog on the side. Default is 1 (center). 
    }; 

    Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
        function success() { },function error(e) {
        }
        
    );

Now, in the web resource how can I extract the parameters from the URL?

I used decodeURIComponent(window.location.search) but it doesn't decode parameters properly.

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can check the way I use in my post - butenko.pro/.../

  • Priyank Bhavsar Profile Picture
    505 on at

    Adrew,

    I checked out your blog but it didn't help me.

    My endcoded URL string is:

    %253FOrderID%253DD0175676-B6B5-E811-A966-000D3A33E0Z2%2526type%253DFresh%2526houseid%253DHouse14.

    After decoding it using decodeURIComponent I get,

    %3FOrderID%3DD0175676-B6B5-E811-A966-000D3A33E0Z2%26type%3DFresh%26houseid%3DHouse14.

    How can I extract values from this decoded string?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Your example gave me an answer - don't use encodeURIComponent to encode data. Xrm.Navigation will do that for you. Try to use

    var pageInput = {
            pageType: "webresource",
            webresourceName: "wo_ProductGrid",
           data: params
        };

  • syed sms Profile Picture
    85 on at

    Hi experts,


    I'm trying to open webresource using  Xrm.Navigation.navigateTo, It is giving error of  "Invalid PageType specified"   following is the error and code

    pastedimage1597230480181v1.png

  • Pramod M Profile Picture
    1,445 on at

    Please check your webresource name has .htm at the end. You can verify the steps from below url.

    carldesouza.com/.../

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    You are trying this on UCI client only right?

    I ask this because this client api is only supported in UCI.

    As suggested make sure you are providing the correct web resource name.

    Also, it is better if you ask question as new forum instead of replying in already verified forum question. This will have better visibility.

    Please Mark My Answer Verified If I Were Helpful

  • syed sms Profile Picture
    85 on at

    Bipin thanks for you reply,

    You are right it is only supported on UCI as for me it is Legacy Interface.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans