保存的搜索记录类型的内部ID(名称/号码)是多少?

时间:2015-07-16 06:41:32

标签: netsuite suitescript

我通过内部标识为customsearch_savedsearch的用户界面为已创建的SearchSearch创建了一个savedSearch。

当我使用套件加载搜索时。它显示我发生了意外错误。

var search = nlapiLoadSearch(null, 'customsearch_savedsearch');

上述语句适用于所有其他记录类型,但对savedSearch记录类型失败。

savedSearch记录类型的内部ID是什么?

7 个答案:

答案 0 :(得分:1)

您不能将null用作第一个参数。加载或创建搜索时,您还必须指定搜索的记录类型。无论customsearch_savedsearch搜索哪种记录类型,都会将您传入的内容作为第一个参数。

因此,例如,如果您保存的搜索是客户搜索,那么您可以通过以下方式加载:

var search = nlapiLoadSearch('customer', 'customsearch_savedsearch');

答案 1 :(得分:0)

尝试

var search = nlapiSearchRecord(null, 'customsearch_savedsearch');

文档:

nlapiSearchRecord(类型,ID,过滤器,列)

使用一组条件(搜索过滤器)和列(结果)执行搜索。或者,您可以使用此API执行现有的已保存搜索。结果限制为1000行。另请注意,在搜索/查找操作中,长文本字段将截断为4,000个字符。 nlapiSearchRecord允许的使用计量为10个单位。

客户端,用户事件,计划,portlet和Suitelet脚本支持此API。

答案 2 :(得分:0)

如果`

var search = nlapiSearchRecord(null, 'customsearch_savedsearch'); 

不起作用`使用

var search = nlapiSearchRecord('', 'customsearch_savedsearch');

答案 3 :(得分:0)

你的陈述中的一切看起来都是正确的。我认为问题是SuiteScript不支持SavedSearch记录类型。以下是supported types

的列表

答案 4 :(得分:0)

你应该可以使用上面提到的

来运行它
def roundrobin_limited_nodupe(limit, *iterables):
    """A round-robin iterator duplicates removed and a limit.

        >>> list(roundrobin_limited_nodupe(6, 'ABC', 'DB', 'EFG'))
        ['A', 'D', 'E', 'B', 'F', 'C']  # only six elements, only one 'B'

    Notes:
      - Recipe credited to George Sakkis

    """
    pending = len(iterables)
    seen = set()  # keep track of what we've seen
    nexts = cycle(iter(it).next for it in iterables)
    while pending:
        try:
            for next in nexts:
                candidate = next()
                if candidate not in seen:  # only yield when it's new
                    seen.add(candidate)
                    yield candidate
                    limit -= 1
                    if limit == 0:
                        return
        except StopIteration:
            pending -= 1
            nexts = cycle(islice(nexts, pending))

我在我的代码中使用了这个,并没有任何问题。确保您在已保存的搜索上设置了正确的权限。首先,将其设置为Public。在观众中,“选择所有”角色。

答案 5 :(得分:0)

您的语法是正确的。但是,即使您可以创建已保存的搜索,保存的搜索类型(也类似于预算记录)也不可编写脚本。这就是您遇到该错误的原因。最有可能的是,支持SuiteScript记录浏览器中列出的那些记录类型。你可以在这里查看清单:

***注意:您应该先登录帐户..
制作https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/account.html

沙箱https://system.sandbox.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/account.html

答案 6 :(得分:0)

我知道这是一个古老的问题,我在尝试这样做时遇到了这个问题,但是我只是成功地尝试了以下内容:

var search = nlapiLoadSearch('savedsearch', 'customsearch_savedsearch');

看起来有点像鼻子,但确实可以解决问题。

相关问题