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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

VendorInvoiceLineEntity - update defaultdimension based on Project's defaultdimension

(0) ShareShare
ReportReport
Posted on by 128
I've extended the VendorInvoiceLineEntity to include VendInvoiceInfoLine_Project as an outer join and am successfully saving/updating records via OData both when I have a project and when I don't.
 
The last hurdle I'm facing is that when a project is included (VendInvoiceInfoLine_Project is populated), the field VendorInvoiceLineEntity.Dimension should be updated to the DefaultDimension from ProjTable for the ProjId in VendInvoiceInfoLine_Project.  In other words, if a Project is populated, the Project's default dimension should be used.  This is what happens when entering a Vendor Invoice through D365 manually.
 
However this field is Private in the Data Entity:

 
Is there any way for me to update this field based on the Project's DefaultDimension?  Note that these are usually Vendor Invoices without POs so we can't pull any data from the PO.
 
From my database (VendInvoiceInfoLine table), the record with DefaultDimension populated below was entered through the D365 application manually where project and project category were entered instead of an account string and the other three records were interfaced through the VendorInvoiceLineEntity with a Project and Project category populated in the message.
 
 
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    305,703 Super User 2026 Season 1 on at
    Moved the question from the Dynamics 365 General to the Dynamics 365 Finance & Project operations forum.
     
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    305,703 Super User 2026 Season 1 on at
    Hi Jackie,
     
    The reason that this field is Private, is because this is storing the reference record ID beloning to a dimension value set. It is not managing the dimensions as concatenated string. 
    In case you want to copy the dimensions from the project, you can use X++ coding to find the dimension and then default the dimension value from the project. You can e.g. use the method mapEntityToDataSource() for this purpose.
  • JackieMc Profile Picture
    128 on at
     Hi,
     
    I'm still getting this compile error when I put the logic in the mapEntityToDataSource() extension:
     
    Field 'this.Dimension' is private and can only be referenced from within the element in which it is declared.
     
    Here's my code in my extension - am I using the wrong syntax for this??:
     
    public void mapEntityToDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)
    {
        switch (_dataSourceCtx.name())
        {
        case dataentitydatasourcestr(VendorInvoiceLineEntity, VendInvoiceInfoLine):
            VendInvoiceInfoLine vendInvoiceInfoLine = _dataSourceCtx.getBuffer();
            if (this.ProjId)
            {
                LedgerDimensionAccount projDefaultDimension = ProjTable::find(this.ProjId).DefaultDimension;
                this.Dimension = projDefaultDimension;
            }
        }
        
        next mapEntityToDataSource(_entityCtx,_dataSourceCtx);
    }
     
    (note I've tried having my case stmt reference VendInvoiceInfoLine and VendInvoiceInfoLine_Project but I get the same result)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 628 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

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

#3
Subra Profile Picture

Subra 437

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans