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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How can I add a find method on my custom table

(0) ShareShare
ReportReport
Posted on by 5

I’m new to Development in D365FO. I’m following the post https://community.dynamics.com/ax/b/axinthefield/posts/using-azure-application-insights-to-monitor-license-usage-in-d365-finance-and-operations

But I’m getting compile errors below.

Severity

Code

Description

Project

File

Line

Suppression State

Error

 

Table 'AppInsightsParameters' does not contain the static method 'find'.

FinanceOperations1 (USR) [TestModel]

C:\AOSService\PackagesLocalDirectory\Bin\XppSource\TestModel\AxClass_CPR_VendEditInvoice_Form_Extension.xpp

11

 

 

This is obvious that I don’t have find method because it is a custom table. But I’m not sure how do I add a find method? Can anyone help me please?

I have the same question (0)
  • Arunraj Rajasekar Profile Picture
    1,743 on at

    Hi Jacky Sam,

    Most out-of-the-box tables include a find method, which you can use as a reference to create your own. The link you are referencing is for completely different requirement.

    thanks,

    Arun  

  • Suggested answer
    Komi Siabi Profile Picture
    13,208 Most Valuable Professional on at

    Here is a sample: Table name is PayrollPeriod

    static PayrollPeriod find(RecId _recId,
    boolean _forUpdate = false)
    {
    PayrollPeriod payrollPeriod;
    
    if (_recId)
    {
    payrollPeriod.selectForUpdate(_forUpdate);
    
    select firstonly payrollPeriod
    where payrollPeriod.RecId == _recId;
    }
    return payrollPeriod;
    }

  • Jacky_Sam Profile Picture
    5 on at

    Thanks Komi, i followed your suggestion and i was able to add a find method based on Recid. I didn't create any unique index on my table, i'm just passing recid as parameter in find method. is it fine?

  • ergun sahin Profile Picture
    8,826 Moderator on at

    For a common table its Ok, but do you have RecId on hand (When you called find method).

    If I m not wrong you are trying create a parameter table. This tables generaly has only a row data so find method a little different (You dont need RecId)

    public static  ParameterTable find(boolean _update = false)
    {
        ParameterTable parameter;
    
        parameter.selectForUpdate(_update);
    
        select firstonly parameter
            index KeyIdx
            where parameter.Key == 0;
    
    
        if (! parameter && ! parameter.isTmp())
        {
            Company::createParameter(parameter);
        }
    
        return parameter;
    }

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    By the way, you can learn more about parameter tables in Parameter System Design Pattern.

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 Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 663

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 439 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 337 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans