Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to JSON Data from CRM to Custom page

Posted on by 40

Hello All,

I have created a custom ribbon button in custom entity and on button click the custom page is opening but in the web resource i have  getting the JSON data from CRM and set in  Custom page but JSON not getting in custom page.

Please help me.

Thanks & Regards,

Vijay

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to JSON Data from CRM to Custom page

    You are correct, parsing of json is missing a few characters in melamri's post. In powerapps it should look like this:

    arevsun_1-1657136090690.png

    I agree with you that it should have been easier sending multiple parameters to a canvas page.

    Check arevsun comment on below post

    powerusers.microsoft.com/.../1566214

  • vijay1234567 Profile Picture
    vijay1234567 40 on at
    RE: How to JSON Data from CRM to Custom page

    hello

    I have already used but its getting the blank value.

    Set(
    entityName,
    Text(Param("entityName"))
    )

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to JSON Data from CRM to Custom page

    Hi,

    You don't need to use json.stringify .  You can simply pass record Id in recordId parameter and you are already passing entity name in entityName.

    Use Param("entityName") to get entity name in your custom page

    Use Param("recordId") to get record Id in your custom page

    entityName String (Optional) The logical name of the table to be made available in the custom page via Param("entityName").

    recordId String (Optional) ID of the table record to be made available in the custom page via Param("recordId").

  • vijay1234567 Profile Picture
    vijay1234567 40 on at
    RE: How to JSON Data from CRM to Custom page

    Hello Andrew Butenko,

    Thank you so much for your quick response.

    this is my JavaScript On Ribbon Button.

    JS Code :

    function openCustomPageUploadDocument(pageContext) {

       debugger;

       var formContext = pageContext;

       var currentID = formContext.data.entity.getId();

       currentID = currentID.replace("{", "").replace("}", "");

       // Centered Dialog

       var pageInput = {

           pageType: "custom",

           name: "new_mycustompage_d7abc",

           entityName: formContext.data.entity.getEntityName(),

           recordId: JSON.stringify({ parentID: currentID, parentLogicalName: formContext.data.entity.getEntityName()})

       };

       var navigationOptions = {

           target: 2,

           position: 1,

           height: { value: 80, unit: "%" },

           width: { value: 70, unit: "%" },

           //title: "Document Uploading"

       };

       Xrm.Navigation.navigateTo(pageInput, navigationOptions)

           .then(

               function () {

                   pageContext.data.refresh();

               }

           ).catch(

               function (error) {

                   alert("Error...");

               }

           );

    }

    Custom Page App onStart :

    Set(
    inputParameters,
    JSON(Param("recordId"))
    );

    Set(

       Test,

       Match(

           inputParameters,

           "\""parentID"":""(?<parentID>[^""]*)"",""parentLogicalName"":""(?<parentLogicalName>[^""]*)"

       )

    );

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to JSON Data from CRM to Custom page

    Hello,

    How do you pass that JSON to custom page? Can you please provide the code that you used from the client side and formulas that you used on custom page side?

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans