2

当用户单击“转到原点”时,我可以轻松创建警报并打开它以打开具有正确记录的表单。

但是,当我要打开的表单需要活动缓冲区时,我不能这样做。在init方法内部,它检查args().

我真正的问题是:

创建警报时如何向表单添加正确的缓冲区?或者我应该将它添加到MenuItem? 因为据我所知,警报知道指向哪里,因为我MenuItem为它提供了一个。那么我什么时候应该提供正确的缓冲区以便表单可以初始化?

4

1 回答 1

3

要完成这样的事情,通常的模式是执行以下操作:

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);
于 2012-02-02T15:43:54.803 回答