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, ...
Unanswered

isAnyFieldSet method for Data Source added to Data Entity

(0) ShareShare
ReportReport
Posted on by 122

We have a requirement to integrate with D365 to create General Journals where some lines will have account strings (Account Type is Ledger) and some lines will have Projects (Account Type is Project).  Our preference is to integrate through Rest API hitting the Data Entity (so not using a file upload).

I copied the LedgerJournalEntity (and relevant classes) and updated IsPublic property.  I can successfully hit the endpoint and create a GJ using Postman for both scenarios.  But for the Project scenario the data on the Project tab isn't being populated (ProjectId, Project Category, etc).  I saw this tab is based on LedgerJournalTrans_Project table and added this as a Data Source to my Data Entity.

Things now work properly if I have a line with a Project but I'm getting an error if I have a line with an Account String as it complains about missing required data when trying to insert into LedgerJournalTrans_Project.  Through debugging, I'm able to see this is because the isAnyFieldSet method for LedgerJournalTrans_Project datasource in SysDataEntityPersister is returning true.

That method is defined at runtime as follows:

    private boolean isAnyFieldSet_DS12(LedgerJournalTrans_Project _ledgerJournalTrans_Project, DataEntityDataSourceRuntimeContext _dataSourceCtx, DataEntityRuntimeContext _entityCtx)
    {
        boolean rtrn = false;
        if(_ledgerJournalTrans_Project.isFieldSet(fieldnum(LedgerJournalTrans_Project,CategoryId)))
        {
            return true;
        }
        if(_ledgerJournalTrans_Project.isFieldSet(fieldnum(LedgerJournalTrans_Project,ProjId)))
        {
            return true;
        }
        if(_ledgerJournalTrans_Project.isFieldSet(fieldnum(LedgerJournalTrans_Project,ProjTransDate)))
        {
            return true;
        }
        if(_ledgerJournalTrans_Project.isFieldSet(fieldnum(LedgerJournalTrans_Project,RefRecId)))
        {
            return true;
        }
        rtrn = this.isAnyFieldSet_Extensions(_entityCtx, _dataSourceCtx, _ledgerJournalTrans_Project) ? true : false;
        return rtrn;
    }

It returns true because RefRecId is populated.

I based my addition of LedgerJournalTrans_Project to this Data Entity on the the way the table LedgerJournalTransExtensionTH was added.

My question is how are the fields to be assessed in the isAnyFieldSet logic determined?  I feel my scenario would work if RefRecId wasn't one of the fields being evaluated and the equivalent join field in LedgerJournalTransExtensionTH (LedgerJournalTrans) is included in the isAnyFieldSet logic for that table.

Note: Similar to LedgerJournalTransExtensionTH, I have code in copyCustomStagingToTarget method to only populate LedgerJournalTrans_Project if the AccountType = Project.

I have the same question (0)
  • Martin Dráb Profile Picture
    239,385 Most Valuable Professional on at

    I moved your question here from the General forum because I'm pretty sure that it's about F&O.

  • JackieMc Profile Picture
    122 on at

    Thank you, Martin.  This is indeed a F&O question.

    I figured it out myself this morning.  If anybody faces the same issue, I had added LedgerJournalTrans_Project.RefRecId to the DataEntity itself and this wasn't necessary.

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 689

#2
André Arnaud de Calavon Profile Picture

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

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans