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, ...
Suggested Answer

Custom Data Entity Not Appearing in Office Integration (Excel Add-in)

(6) ShareShare
ReportReport
Posted on by 68

Hi everyone,

I’ve created a custom data entity with the header data source as LedgerJournalTable, and added it as a template so that it can be opened in Excel using the Office Add-in.

According to the Microsoft Learn documentation, when the header data source of the entity matches the main data source of the form, the entity should automatically appear in the Office Integration section of the form.

However, in my case, it’s not showing up under the Office integration options.

Has anyone faced a similar issue or know what could be missing in my setup?

 
using Microsoft.Dynamics.Platform.Integration.Office;
/// <summary>
/// The <c>ExpenseJournalExcelTemplate</c> is the supporting class for the expense journal excel template.
/// </summary>
public class ExpenseJournalExcelTemplateCopy extends DocuTemplateRegistrationBase implements LedgerIJournalExcelTemplate
{
    private const DocuTemplateName ExcelTemplateName    = resourceStr(ProjectExpenseJournalCopy);
    private const DataEntityName LineEntityName         = tableStr(ExpenseJournalLineEntityCopy);
    private const FieldName LineEntityJournalNum        = fieldStr(ExpenseJournalLineEntityCopy, JournalBatchNumber);
    private const FieldName LineEntityDataAreaId        = fieldStr(ExpenseJournalLineEntityCopy, dataAreaId);
    private const DataEntityName HeaderEntityName       = tableStr(ExpenseJournalHeaderEntityCopy);
    private const FieldName HeaderEntityJournalNum      = fieldStr(ExpenseJournalHeaderEntityCopy, JournalBatchNumber);
    private const FieldName HeaderEntityDataAreaId      = fieldStr(ExpenseJournalHeaderEntityCopy, dataAreaId);
    public boolean isJournalTypeSupported(LedgerJournalType _ledgerJournalType)
    {
        return _ledgerJournalType == LedgerJournalType::Cost;
    }
    public void applyCustomTrimming(Excel.IWorkbookManager _templateManager, Excel.WorkbookSettingsManager _settingsManager, LedgerJournalTable _ledgerJournalTable)
    {
    }
    public DocuTemplateName documentTemplateName()
    {
        return ExcelTemplateName;
    }
    public Set supportedAccountTypes()
    {
        Set accountTypeSet = new Set(Types::Integer);
        accountTypeSet.add(LedgerJournalACType::Project);
        return accountTypeSet;
    }
    public Set supportedOffsetAccountTypes()
    {
        Set offsetAccountTypeSet = new Set(Types::Integer);
        offsetAccountTypeSet.add(LedgerJournalACType::Ledger);
        offsetAccountTypeSet.add(LedgerJournalACType::Cust);
        offsetAccountTypeSet.add(LedgerJournalACType::Vend);
        offsetAccountTypeSet.add(LedgerJournalACType::Bank);
        return offsetAccountTypeSet;
    }
    public boolean validateJournalForTemplate(LedgerJournalTable _ledgerJournalTable)
    {
        return LedgerJournalExcelTemplate::validateJournalForTemplate(_ledgerJournalTable, this);
    }
    public void registerTemplates()
    {    
        this.addTemplate(
                OfficeAppApplicationType::Excel,
                ExcelTemplateName,
                ExcelTemplateName,
                literalStr("Journal lines copy for project"),
                literalStr("Journal lines copy for project"),
                NoYes::No,
                NoYes::No);
    }
    public DataEntityName headerEntityName()
    {
        return HeaderEntityName;
    }
    public DataEntityName lineEntityName()
    {
        return LineEntityName;
    }
    public FieldName headerJournalBatchNumberFieldName()
    {
        return HeaderEntityJournalNum;
    }
    public FieldName headerDataAreaFieldName()
    {
        return HeaderEntityDataAreaId;
    }
    public FieldName lineJournalBatchNumberFieldName()
    {
        return LineEntityJournalNum;
    }
    public FieldName lineDataAreaFieldName()
    {
        return LineEntityDataAreaId;
    }
    public Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode appendHeaderEntityFilters(Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode _headerFilter, ExportToExcelFilterTreeBuilder _headerFilterBuilder)
    {
        return _headerFilter;
    }
    public Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode appendLineEntityFilters(Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode _lineFilter, ExportToExcelFilterTreeBuilder _lineFilterBuilder)
    {
        Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode ledgerVend = _lineFilterBuilder.or(
            _lineFilterBuilder.areEqual(fieldStr(ExpenseJournalLineEntityCopy, OffsetAccountType), LedgerJournalACType::Ledger),
            _lineFilterBuilder.areEqual(fieldStr(ExpenseJournalLineEntityCopy, OffsetAccountType), LedgerJournalACType::Vend));
        Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode custBank = _lineFilterBuilder.or(
            _lineFilterBuilder.areEqual(fieldStr(ExpenseJournalLineEntityCopy, OffsetAccountType), LedgerJournalACType::Cust),
            _lineFilterBuilder.areEqual(fieldStr(ExpenseJournalLineEntityCopy, OffsetAccountType), LedgerJournalACType::Bank));
        Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode offsetFilters = _lineFilterBuilder.or(ledgerVend,custBank);
        Microsoft.Dynamics.Platform.Integration.Office.FilterCollectionNode ledgerFilter = _lineFilterBuilder.and(
            _lineFilterBuilder.areEqual(fieldStr(ExpenseJournalLineEntityCopy, AccountType), LedgerJournalACType::Project),
            offsetFilters);
        return _lineFilterBuilder.and(_lineFilter, ledgerFilter);
    }
}
Categories:
I have the same question (0)
  • Adis Profile Picture
    6,593 Super User 2026 Season 1 on at
    Hey,
     
    As far as I understood, you added the template here.
    Could you show us the root data entity and also where you expect it to appear, in which form?
    I guess when you uploaded it you have left the specific company, region or language empty, or?
     
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

     
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,669 Super User 2026 Season 1 on at
    Hi,
     
    For journals, the new templates are not showing up by default. Only when you overwrite an existing template. If you need to have additional options to choose from, a customization is required. 
     
    The automatic addition is valid for about 98% of the forms. Journals are handled in a different way with X++ coding.
  • AP-17101228-0 Profile Picture
    68 on at
     i've refered the blog and did as per these steps and implements the interface of  LedgerIJournalExcelTemplate the entity created was shown in entity list but it was not available in open in excel
     
     
     
  • AP-17101228-0 Profile Picture
    68 on at
     yes  company , region, and language are left empty in my entity
  • André Arnaud de Calavon Profile Picture
    303,669 Super User 2026 Season 1 on at
    Hi,

    I see some code extensions you probably used. Have you used the debugger already to see if your extension is triggered and executes all according to the expectations? 
  • AP-17101228-0 Profile Picture
    68 on at
    @André Arnaud de Calavon 

    I have not used any extension  , i created a custom entity and i was unable to make it available in excel addin
  • Adis Profile Picture
    6,593 Super User 2026 Season 1 on at
    Hey,
     
    The following things came to my mind that you could check if you haven't already.
     
     
    Is the Integration mode set properly? If you have set it to data management, you wont see it in the excel add-in.
     
     
     
     
    Are you SysAdmin in the environment you are testing it? Non-admins will have to have a privilege in order to view\maintain the entity.
     
     

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans