web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / timesheetdetail failed...
Power Apps
Unanswered

timesheetdetail failed: ErrorCode: Internal_DataNotFoundFilter

(0) ShareShare
ReportReport
Posted on by 1
I am making an Hour Registration App in Power Apps and using the Business Central connector. I exposed 3 tables of BC "Time Sheet Header", "Time Sheet Line" and "Time Sheet Detail" with AL language. This is what my App looks like as well as the code:
 
If(
    IsBlank(ddlResource.Selected),
    Notify("Select a Resource.", NotificationType.Error),
    IsBlank(dpDate.SelectedDate),
    Notify("Select a Date.", NotificationType.Error),
    varTypeBC = "Project" && (IsBlank(jobNo.Selected) || IsBlank(jobTaskNo.Selected)),
    Notify("Select a Project and a Job Task.", NotificationType.Error),
    varTypeBC = "Absence" && IsBlank(cmbAbsence.Selected),
    Notify("Select a Cause of Absence.", NotificationType.Error),
    !IsNumeric(txtQuantity.Text) || Value(txtQuantity.Text) <= 0,
    Notify("Enter a positive number of hours.", NotificationType.Error)
);
 
Set(
    varWeekStart,
    DateAdd(dpDate.SelectedDate, 1 - Weekday(dpDate.SelectedDate, StartOfWeek.Monday), TimeUnit.Days)
);
 
Set(
    varHeader,
    LookUp(
        'timesheetheaderpowerapps (clobotics/finance/v1.0)',
        'Starting Date' = varWeekStart &&
        'Resource No.' = ddlResource.Selected.'No.'
    )
);
 
If(IsBlank(varHeader),
    Notify("Timesheet Header not found! Cannot create line.", NotificationType.Error)
);
 
Set(
    varAccountingPeriod,
    LookUp(
        SortByColumns(
            Filter(
                'abiAccountingPeriods (abakion/bi/v2.0)',
                'Starting Date' <= dpDate.SelectedDate && Closed = false
            ),
            "startingDate",
            SortOrder.Descending
        ),
        true
    )
);
 
If(IsBlank(varAccountingPeriod),
    Notify("No open accounting period found for the selected date.", NotificationType.Error)
);
 
Set(
    varPeriodStart,
    DateAdd(
        Date(1970,1,1),
        Value(varAccountingPeriod.'Starting Date') / 1000,
        TimeUnit.Seconds
    )
);
 
Set(
    varLine,
    Patch(
        varHeader,
        Defaults('timesheetlinepowerapps (clobotics/finance/v1.0)'),
        {
            'Project No.': jobNo.Selected.'No.',
            'Project Task No.': jobTaskNo.Selected.'Project Task No.',
            'Work Type Code': workType.Selected.Code,
            'Type': type.Selected.Value
       
        }
    )
);
 
Set(
    varDetail,
    Patch(
        'timesheetdetailpowerapps (clobotics/finance/v1.0)',
        Defaults('timesheetdetailpowerapps (clobotics/finance/v1.0)'),
        {
           
            'Cause of Absence Code': cmbAbsence.Selected.Code,
            'Posted Quantity': Value(txtQuantity.Text),
            Type: type.Selected.Value,
            Status: "Submitted"
        }
    )
);
 
If(
    IsBlank(varLine),
    Notify("Failed to create Timesheet Line.", NotificationType.Error),
    IsBlank(varDetail),
    Notify("Failed to create Timesheet Detail.", NotificationType.Error),
    Notify("✅ Timesheet Line and Detail registered successfully!", NotificationType.Success)
)

timesheetdetail failed: ErrorCode: Internal_DataNotFoundFilter There is no Accounting Period within the filter.Filters: Starting Date: ..'' 

When I try to register hours, I get the error No Accounting Period in the Filter. I don't know how to filter. Accounting Periods exist in Business Central and are open. When I do the Hour Registration in BC with the same fields I'm using now, it's done successfully.
But not everyone who will register their hours have access to our Business Central (like external technicians etc..).

The two fields showing 8/1/2025 and unix time are fetched automatically when I choose the user and date. Both are the Accounting Period fetched for that Time Sheet.

I am a complete beginner, please heeelp :D
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,978 Moderator on at
     
    A couple quick feedbacks as you are just starting :-)
     
    1. Lol the ui is not your fault, but use carriage returns as it just does not word wrap. Not your fault, but soon as you get to where it's going to (you think) get long hit return lol again not your fault, but as you can see
    it runs way over and into pictures etc.. the UI is... GOOFY lol
     
    2. Your Subject should be something more descriptive related to Power apps and BC, the error part is ok, but the rest is confusing as no one knows it means BC
     
    3. You do not mention exactly which line is failing. While some of us know BC and can guess, its best
    to show exactly which line is failing as the rest of the code is not important really.
     
    When it talks about Filters, (by default) it means when you are doing a LookUp, not when you are doing a Patch, unless the patch has a Filter(lookup) in it, which you do not. 
     
    So is it your lookup failing? your patch?
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard