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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Add new field to map

(0) ShareShare
ReportReport
Posted on by

Hi,

I need to add a new field to VendDocumentTableMap. I understood that it is not possible to create extension form maps and I need to use an Interface class. But i don't know how to bound the existing map with the new interface class.

Thank you 

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    There is no interface class for this map as far as I know.

    But you can work around the limitation by casting the map into the underlying table buffer in your code. This way you can access your custom field.

    Here's an example with SalesPurchLine map.

    if (salesPurchLine.TableId == tabeNum(SalesLine)
    {
        SalesLine salesLine = salesPurchLine;
        info(salesLine.MyField);
    }

  • Blue Wang Profile Picture
    on at

    Hi Gabi,

    You cannot add fields to an existing map via extension.

    Microsoft has implemented some mappings as interfaces, but not all classes have interface classes.

    docs.microsoft.com/.../maps-as-interfaces

    As mentioned, You can access your custom fields using the table buffer instead of your map.

    if (_custVendInvoiceJour.TableId == tableNum(CustInvoiceJour))
        {
            custInvoiceJour = CustInvoiceJour::findRecId(_custVendInvoiceJour.RecId);
            // Now you can access your custom fields of CustInvoiceJour
        }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans