如何获取 Class 来电者姓名?

How to get Class caller name ?

我的问题很简单,但我不知道该怎么做。

我有一个 Table 方法,我想得到 class 调用者。

我使用了这个代码:

Args _args = new Args();

但我不知道如何使用 for 获取名称 class。

谢谢大家!

尝试使用:

_args.caller().name()

示例:

if (_args.caller() && _args.caller().name() == classstr(LogisticsLocationSelectionLookup)) { ... }

看到这个Link:

http://kiwiaxguy.blogspot.com.br/2011/02/checking-to-see-if-caller-is-form.html

您应该使用此方法来获取名称或类 ID。

Args args = new Args();

args.caller(SalesFormLetter::construct(DocumentStatus::Invoice));

info(strFmt("%1", classId2Name(classIdGet(args.caller()))));

具体来说:

classId2Name(classIdGet(args.caller()))

您无权从 table 方法访问调用者,除非您明确将其作为方法的参数。

嗯,有 xSession::xppCallStack(),但它应该用于 debugging 或仅用于诊断。