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

Notifications

Announcements

Community site session details

Community site session details

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

How to extend PurchFormletterParmDataInvoice . createFieldMappingForVendInfoInvoiceLineAsset()

(2) ShareShare
ReportReport
Posted on by 237
I need to extend  PurchFormletterParmDataInvoice . createFieldMappingForVendInfoInvoiceLineAsset() and PurchFormletterParmDataInvoice.getQueryForVendInfoInvoiceLineAsset() to insert new custom fields that have been added.
I added the following extension 
[ExtensionOf(classStr(PurchFormletterParmDataInvoice))]
final class PurchFormletterParmDataInvoice_PAS_Extension
{

    protected final Map createFieldMappingForVendInfoInvoiceLineAsset(
        QueryBuildDataSource _qbdsVendInvoiceInfoLineUpdate,
        QueryBuildDataSource _qbdsLocalPurchLine)
    {

        Map targetToSourceMap = new Map(Types::String, Types::Container);

        targetToSourceMap = next createFieldMappingForVendInfoInvoiceLineAsset(_qbdsVendInvoiceInfoLineUpdate, _qbdsLocalPurchLine);
        targetToSourceMap.insert(fieldStr(VendInvoiceInfoLine_Asset, CustField1), [_qbdsLocalPurchLine.uniqueId(), fieldStr(PurchLine, CustField1)]);
        targetToSourceMap.insert(fieldStr(VendInvoiceInfoLine_Asset, CustField2), [_qbdsLocalPurchLine.uniqueId(), fieldStr(PurchLine, CustField2)]);
        return targetToSourceMap;
    }

    protected final Query getQueryForVendInfoInvoiceLineAsset()
    {
        Query query = new Query();

        query   = next getQueryForVendInfoInvoiceLineAsset();

        QueryBuildDataSource qbdsPurchLine = query.dataSourceTable(tableNum(PurchLine));

        QueryBuildFieldList     fieldList = qbdsPurchLine.fields();
        fieldList.dynamic(QueryFieldListDynamic::No);

        qbdsPurchLine.addSelectionField(fieldNum(PurchLine, CustField1));
        qbdsPurchLine.addSelectionField(fieldNum(PurchLine, CustField2));

        return query;
    }

}
This code works on the Dev box and does what I intended the code to do.  It builds clean no errors.  However, when checking in the code to DevOps it fails the build with the following error.  "dynamics://Class/PurchFormletterParmDataInvoice_PAS_Extension/Method/createFieldMappingForVendInfoInvoiceLineAsset(12,29) - The next method cannot be invoked in method 'createFieldMappingForVendInfoInvoiceLineAsset' because it's not a Chain Of Command Method."
 
How can I fix this and what is the best practise
Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    238,208 Most Valuable Professional on at
    This isn't an error from Azure DevOps - it's an X++ compilation. Do you mean that you have a gated build before checking into DevOps and the compilation fails on the build server while it succeeds on your dev box? If so, the question is how the build machine differs from your machine. For example, maybe they have different versions of standard code.
  • Suggested answer
    Sagar121 Profile Picture
    941 on at
    Hi, I checked this method found this description. So possibly your Build VM or nuget packages are on latest version. This might have great deprecated or Wrappable may be false in latest release.
     
     [Wrappable(true),
      SysObsolete('This method will be deprecated in a future release, use createFieldMappingForVendInfoInvoiceLineAsset instead.', false, 04\04\2024)]
     protected final Map createFieldMappingForInvoiceLineAsset(
         QueryBuildDataSource _qbdsVendInvoiceInfoLineUpdate,
         QueryBuildDataSource _qbdsLocalPurchLine)
     {

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 763 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 284 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans