Netsuite Suitescript可以修改文件柜中的文件吗?
我有一个很大的产品列表,需要生成它的静态文件,并让该文件可以在我的网站中访问。目前,我生成列表,并将其上传到文件柜。我希望自动化这个过程。我想安排一个 SuiteScript 每晚运行并生成此列表并更新文件柜中的文件。
这可以做到吗?
谢谢
I have a large product list and need to generate a static file of it, and have that file be accessible in my website. Currently, I generate the list, and upload it to the file cabinet. I wish to automate this process. I would like to schedule a SuiteScript to run each night and generate this list and update a file in the file cabinet.
Can this be done?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 SuiteScript 自动执行此过程。您将使用 nlapiLoadFile 和 nlapiSubmitFile 调用来完成它。如果您的产品列表很大,您可能会遇到一些其他问题。您可能会达到治理限制,并且需要开发此脚本,以便它跟踪进度并适当地重新安排自身。 SuiteScript 搜索将仅返回前 1000 条记录。如果您要在此文件中包含超过 1000 个项目,您可能需要在项目记录上使用标记来跟踪哪些项目仍待导出。目前,使用 SuiteScript 加载或创建文件时,文件大小有 5MB 的限制。
You can automate this process with SuiteScript. You would use the nlapiLoadFile and nlapiSubmitFile calls to accomplish it. If you have a large product list you are likely to encounter a few other issues. You are likely to hit governance limits and will need to develop this script so that it tracks progress and reschedules itself appropriately. SuiteScript searches will only return the first 1000 records. If you have more than 1000 items to include in this file, you will likely need to use a flag on the item record to track which items remain for export. There is currently a 5MB limit on the file size when loading or creating files using SuiteScript.
创建文件的 SuiteScript 示例:
Example SuiteScript to create a file:
是的,您可以使用计划脚本来完成此操作并根据您的意愿安排它们。
没有特殊的 API 函数来编辑现有文件,您可以获取现有文件的详细信息并创建具有相同详细信息的新文件,但仅更改数据字段并删除旧文件。
Yes, you could do it using scheduled Scripts and schedule them as your wish.
There is no special API function to edit an existing file, you could take the details of the existing file and create a new file with the same details but changing the data field only and deleting the old file.