无论如何知道它是否存储在savesearch中 [英] Anyway to know it is stored in savedsearch or not

查看:135
本文介绍了无论如何知道它是否存储在savesearch中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用savedsearch搜索.

I'd like to search using savedsearch.

这是我的代码段.

 var searchresults = nlapiSearchRecord('item', search_id, null, null);

search_id被定义为文本字段中的参数. 这是suitelet脚本,因此,如果在savedsearch中找不到相似的search_id,则会引发异常.

search_id is defined as parameter in text field. This is suitelet script so if you couldn't find similar search_id in savedsearch then it throws exception.

为避免这种情况,我想检查保存的搜索中是否有任何类似的内部ID.

To avoid this I'd like to check if there is any similar internal id in saved searches.

例如,如果有两个已保存的搜索,其ID为customsearch1customsearch2.

For instance if there are two saved searches which ids are customsearch1, customsearch2.

如果search_id'cust',则它将引发异常并且脚本以错误结束.

If search_id is 'cust' then it throws exception and script finished with error.

它在脚本日志中显示

'That search or mass update does not exist.'

期待您的回音. 问候

推荐答案

您可以通过将search_id参数更改为保存的搜索的列表/记录"来防止这种情况.

You could prevent this by changing your search_id parameter to a List/Record of Saved Searches.

为什么必须是文本字段?

Any reason why it has to be a text field?

这篇关于无论如何知道它是否存储在savesearch中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆