2011-11-17 49 views
2

我可以輕鬆創建警報,並在用戶單擊「Go to Origin」時打開帶有正確記錄的表單。Dynamics AX警報到需要有效緩衝區的表單

我不能這樣做,當我想要打開的表單需要一個活動的緩衝區,但。在init方法中,它檢查args()上的正確緩衝區。

我真正的問題是:

如何創建一個提醒,當正確的緩衝液添加到窗體?或者我應該將它添加到MenuItem?因爲據我所知,警報知道在哪裏指向,因爲我爲它提供MenuItem。那麼我應該何時提供正確的緩衝區,以便表單可以初始化?

回答

3

要acomplish這樣的事情通常的模式是這樣做的以下內容:

Args args; 
MyTable myTable; 
MenuFunction menuFunction; 

// Find the record that needs to be passed. This could also be done through a 
// select or a call to any function returns a record of the type needed. 
myTable = MyTable::find(123); 

menuFunction = new MenuFunction(menuitemDisplayStr(MyMenuItem), MenuItemType::Display); 
args = new Args(); 
args.record(myTable); 
menuFunction.run(args);