Skip to main content

Notifications

Community site session details

Community site session details

Session Id : W2GGG4MDbvyc5Dpj/O6jyt
Power Apps - Microsoft Dataverse
Unanswered

CUSTOM PAGES

Like (1) ShareShare
ReportReport
Posted on 8 Nov 2024 22:54:27 by 14
Custom page isn't receiving data from javascript. Console log shows everything correctly.
Categories:
  • EricaB-I.T. Profile Picture
    14 on 11 Nov 2024 at 14:15:49
    CUSTOM PAGES
    It's a Power Apps Custom Page.
  • bscarlavai33 Profile Picture
    588 Super User 2025 Season 1 on 11 Nov 2024 at 04:30:42
    CUSTOM PAGES
    Is it a Power Apps Custom Page or an html/js web resource custom page?
  • EricaB-I.T. Profile Picture
    14 on 10 Nov 2024 at 14:40:40
    CUSTOM PAGES
    Here is how the app comes across after the click. 
  • EricaB-I.T. Profile Picture
    14 on 10 Nov 2024 at 14:38:33
    CUSTOM PAGES
    I guess it was too long if I put everything in one post? Anyway, my parameters set on the button :  Param 1 Boolean>true; Param 2 FirstPrimaryItemId; Param 3 SelectedControlSelectedItemIds    
     
    Here is the console log
  • EricaB-I.T. Profile Picture
    14 on 10 Nov 2024 at 14:36:01
    CUSTOM PAGES
    Hello, 

    I have model driven app for Customer's. Within the app is a subgrid for the Plan of Action table.  I created a Custom Page that IS opening when the button is pressed, the data is showing up in the Console, however, it is NOT flowing to my custom page. I have screenshots of the console, button parameters, and custom page in the attachment.  My OnVisible property is set to: 
    Set(
        CustomerRecordId,
        If(
            !IsBlank(Param("Customer Id")),
            Param("Customer Id"),
            "No CustomerRecordId proved."
        )
    );

    // Log to check if CustomerRecordId is set correctly
    If(
        !IsBlank(CustomerRecordId),
        Notify("CustomerRecordId: " & CustomerRecordId),
        Notify("No CustomerRecordId provided.")
    );
  • EricaB-I.T. Profile Picture
    14 on 10 Nov 2024 at 14:35:10
    CUSTOM PAGES
    function openPlanOfActionPage(isNew, customerRecordId, planOfActionRecordId = "") {
        // Log whether we're creating a new record or editing an existing one
        console.log("Is New Record:", isNew);
     
        // Verify that customerRecordId and planOfActionRecordId are strings
        if (typeof customerRecordId !== 'string') {
            console.warn("Warning: customerRecordId is not a string. Converting to string:", customerRecordId);
            customerRecordId = String(customerRecordId); // Convert to string if needed
        }
        if (typeof planOfActionRecordId !== 'string') {
            console.warn("Warning: planOfActionRecordId is not a string. Converting to string:", planOfActionRecordId);
            planOfActionRecordId = String(planOfActionRecordId); // Convert to string if needed
        }
     
        // Log the Customer Record ID and Plan of Action Record ID (if editing)
        console.log("Customer Record ID (for linking to new record):", customerRecordId);
        console.log("Plan of Action Record ID (if editing existing record):", planOfActionRecordId);
     
        // Set up the page input
        var pageInput = {
            pageType: "custom",
            name: "eb_planofaction_1ca91", // Logical name of the custom page
            entityName: "eb_planofaction",    // Logical name of the Plan of Action table
            recordId: isNew ? "" : planOfActionRecordId.replace(/[{}]/g, "") // Only set recordId if editing an existing Plan of Action
        };
     
        // If creating a new record, pass the Customer ID as a parameter
        if (isNew) {
            pageInput.parameters = { customerId: customerRecordId.replace(/[{}]/g, "") };
        }
     
        // Log the complete page input object to verify all details
        console.log("Page Input Object:", JSON.stringify(pageInput));
     
        // Set up navigation options
        var navigationOptions = {
            target: 1, // Open in a new page
            width: 800, // Set the width of the dialog
            height: 600 // Set the height of the dialog
        };
     
        // Log the navigation options to ensure they are correctly configured
        console.log("Navigation Options:", JSON.stringify(navigationOptions));
     
        // Attempt to navigate to the page
        Xrm.Navigation.navigateTo(pageInput, navigationOptions)
            .then(function () {
                console.log("Navigation to custom page successful.");
            })
            .catch(function (error) {
                console.log("Error navigating to custom page:", error);
            });
    }
     
    // Usage example: Open a new Plan of Action for a specific Customer
    function openNewPlanOfActionForCustomer(executionContext) {
        var formContext = executionContext.getFormContext(); // Get the current form context
        var customerRecordId = formContext.data.entity.getId(); // Get the Customer record's GUID
     
        // Log to confirm we're opening a new Plan of Action with the correct Customer ID
        console.log("Opening new Plan of Action for Customer Record ID:", customerRecordId);
     
        // Open a new Plan of Action and pass the Customer record ID as a parameter
        openPlanOfActionPage(true, customerRecordId);
    }
     
    // Usage example: Open an existing Plan of Action
    function openExistingPlanOfActionForCustomer(planOfActionRecordId) {
        // Log to confirm we're opening an existing Plan of Action
        console.log("Opening existing Plan of Action with Record ID:", planOfActionRecordId);
     
        // Open an existing Plan of Action by passing the Plan of Action record ID
        openPlanOfActionPage(false, "", planOfActionRecordId);
    }
  • EricaB-I.T. Profile Picture
    14 on 10 Nov 2024 at 14:34:21
    CUSTOM PAGES
    I was able to add script and screenshots.
  • mmbr1606 Profile Picture
    12,267 Super User 2025 Season 1 on 09 Nov 2024 at 12:34:54
    CUSTOM PAGES
    hey
     
     
    you need to give us more details of code and maybe screenshots of your app. what is not working?which errors are u seeing?
     
     
    cheers

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 15

#2
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

Overall leaderboard

Featured topics