[英]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 = CustTable
和DataMethod = MyClass_extension::displayYesCustTable
,這是正常的。 (見截圖)
問題:我創建了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.