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.

  • syed sms Profile Picture
    85 on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

    Bipin thanks for you reply,

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

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

    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

  • Pramod M Profile Picture
    1,445 on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

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

    carldesouza.com/.../

  • syed sms Profile Picture
    85 on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

    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

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

    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
        };

  • Priyank Bhavsar Profile Picture
    505 on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

    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?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Get parameters passed to a webresource using Xrm.Navigation.navigateTo

    Hello,

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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 91

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans