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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to JSON Data from CRM to Custom page

(0) ShareShare
ReportReport
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

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

    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?

  • vijay1234567 Profile Picture
    40 on at

    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>[^""]*)"

       )

    );

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

    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
    40 on at

    hello

    I have already used but its getting the blank value.

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

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

    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

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans