簡體   English   中英

AX7:使用擴展方法在View上創建方法(bug?)

[英]AX7: Creating a method on a View using the extension method (bug?)

編輯:問題是,為什么view上的顯示方法不起作用?

我正在嘗試使用擴展方法在DirPartyPostalAddressView上創建一個顯示方法,據我所知,這可能是一個AX7錯誤,或者我做錯了。 最近的更新是關於最新的AX7。

我正在使用此處詳述的方法https://blogs.msdn.microsoft.com/mfp/2015/12/15/x-in-ax7-extension-methods/

我創建了一個概念驗證display method用於視圖DirPartyPostalAddressView vs表CustTable以顯示可能的bug

擴展類代碼:

 static class MyClass_extension { public static display NoYesId displayYesDirPartyPostalAddressView (DirPartyPostalAddressView _this) { return NoYes::Yes; } public static display NoYesId displayYesCustTable (CustTable _this) { return NoYes::Yes; } } 

我創建一個CustTable形式的擴展,添加一個復選框控件,設置DataSource = CustTableDataMethod = MyClass_extension::displayYesCustTable ,這是正常的。 (見截圖)

CodeChanges

工作形象

問題:我創建了LogisticsPostalAddressGrid形式的擴展,向網格添加了一個復選框控件,設置了DataSource = DirPartyPostalAddressView並且它沒有編譯。 (見截圖)

錯誤是:

The data method 'MyClass_extension::displayYesDirPartyPostalAddressView' was not found on the data source 'DirPartyPostalAddressView' or its base table/view.

非編譯

這已被確認為錯誤,將在下一個平台版本中修復。

請參閱: https//connect.microsoft.com/site1321/feedback/details/3100997/data-methods-are-not-found-using-extension-method-on-views

我認為你應該在視圖上使用計算列,而忘記那里的顯示方法。

在AX幫助Wiki中查看此內容 我想,為了測試目的,如果在計算列的方法中你只需“返回'1'”或“返回true”就足夠了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM