Skip to main content
Community site session details

Community site session details

Session Id : bsBouNgtaVr2aUrcPgu/Rv
Power Pages - General Discussions
Answered

Internal Server Error

Like (0) ShareShare
ReportReport
Posted on 12 Feb 2025 12:25:04 by 23

 Hi All 
 
Apologies for the late response - my notifications were lost in the mix with the other mail I receive. 
And apologies for the lack of detail in my question. Here are the full details of my issue:
 
I am working with Dynamics BC, Power Pages/Power Apps to complete this task.
I have set out to create a a customer portal that will give our users access to printed stock they have stored in our warehouse. 
Long story short, I opted to create a custom table, 'Customer Item Group' and an API Page to expose the table to the portal being developed in Power Pages. 
 
I've published the API Page to the Dataverse and as  result can Read, Insert, Modify and Delete entries in the table and the results of my actions are followed through to BC. I can also view the table and perform the same RIMD actions from the Power Pages 'Data' page.
 
I can create a list out of the 'Customer Item Group' Dataverse table with no errors BUT when I go to preview the list (as an authenticated user) on the webpage I get the 'Internal Error 500' message. I have set the table permissions so that Authenticated Users and Administrators can view the data. Table access is set to Global since there are no table relations.  On further investigation in the console I've found a more elaborate message: 
 
 
 
On discovering this I made a few changes, which includes creating a permission set in visual studio code which includes the permissions set:
 
namespace CIG;
using System.Security.AccessControl;

permissionset 50100 "CIG_Permissions"
{
    IncludedPermissionSets = "D365 BUS FULL ACCESS", "D365 READ", "D365 BASIC";
    Assignable = true;
    Permissions = tabledata "Customer Item Groups" = RIMD,
        tabledata Customer_Item_Group_Code = RIMD,
        table "Customer Item Groups" = X,
        table Customer_Item_Group_Code = X,
        page "API Customer Item Group Code" = X,
        page "API Customer Item Groups" = X,
        page "Customer Item Group Code" = X,
        page "Customer Item Groups" = X;
}


But this didn't help. Here's the code for my table and page respectively:
 
table 50100 "Customer_Item_Group_Code"
{

    Caption = 'Customer Item Group Code';
    DataCaptionFields = "number", Description;
    DataClassification = CustomerContent;
    Permissions = tabledata Customer_Item_Group_Code = R;

    fields
    {
        field(10; "number"; Code[15])
        {
            Caption = 'No.';
            NotBlank = true;
            DataClassification = CustomerContent;
        }

        field(20; description; Text[30])
        {
            Caption = 'Description';
            DataClassification = CustomerContent;
        }

    }

    keys
    {
        key(PK; "number")
        {
            Clustered = true;
        }
    }

    fieldgroups
    {
        // Add changes to field groups here
        fieldgroup(DropDown; "number", Description) { }
    }

}

 
API Page
 
page 50105 "API Customer Item Group Code"
{
    pagetype = API;
    // ApplicationArea = All;
    // UsageCategory = Administration;

    APIVersion = 'v2.0';
    APIPublisher = 'Dataverse';
    APIGroup = 'CustomerItemGroupsVT';

    EntityCaption = 'Customer Item Group Code';
    EntitySetCaption = 'Customer Item Group Codes';
    EntitySetName = 'customerItemGroupCodes';
    EntityName = 'customerItemGroupCode';

    ODataKeyFields = SystemId;
    SourceTable = Customer_Item_Group_Code;
    permissions = tabledata Customer_Item_Group_Code = RIMD;

    Extensible = false;
    DelayedInsert = true;


    layout
    {
        area(Content)
        {

            repeater(Group)
            {

                field(id; Rec.SystemId)
                {
                    Caption = 'Id';
                    Editable = false;
                }
                field(groupNo; Rec."number")
                {
                    Caption = 'No.';
                }

                field(customerNo; Rec.description)
                {
                    Caption = 'Description';
                }
            }
        }
    }
}


 
I hope I've provided enough information here. Thanks
Categories:
  • Verified answer
    MO-12021219-0 Profile Picture
    23 on 20 Feb 2025 at 10:25:45
    Internal Server Error
    Hi I managed to resolve my problem giving permissions to the power pages users on the 'Microsoft Entra Application' page.
  • Lucas001 Profile Picture
    2,268 Super User 2025 Season 2 on 18 Feb 2025 at 16:05:28
    Internal Server Error
    Is the list available during the preview or is it directly failing to load?
  • Michael E. Gernaey Profile Picture
    45,440 Super User 2025 Season 2 on 13 Feb 2025 at 08:12:52
    Internal Server Error
    Hi
     
    There are no real details here. Please provide all the code, expressions, flow actions, inputs and outputs etc etc.
     
    Happy to help

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!