如何使用SuiteScript获得模块数据NetSuite的? [英] How to get data of modules in NetSuite using SuiteScript?

查看:3389
本文介绍了如何使用SuiteScript获得模块数据NetSuite的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用NetSuite和有喜欢的员工,物品等,我想访问一些记录/表格。我已阅读有关使用SuiteScript摆脱NetSuite的数据,并创建了NetSuite的新模块。我想知道我可以在NetSuite的访问记录,从现有的数据?比如我想获得的所有员工,项目或其他记录类型的列表。我无法理解如何去获取这些信息。我已经提供了一些API NetSuite的记录,字段和放大器;形式。请帮我为我在NetSuite的初学者。

I am using NetSuite and there are some records/forms like employees, items etc. that I would like to access. I have read about using SuiteScript to get the data from NetSuite and for creating new modules in the NetSuite. I want to know how can I access existing data from records in NetSuite? For example I would like to get the list of all employees, items or other record types. I am not able to understand how to go about accessing this information. I've been provided some of the NetSuite API Records, Fields & Forms. Please help me as I'm a beginner in NetSuite.

推荐答案

这是在.NET中使用NetSuite的网络服务在这里我加载机会记录的例子。装载员工或其他记录的过程是一样的。一旦你的基本工作阅读<一href=\"https://system.sandbox.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2015_1/script/record/account.html\"相对=nofollow> NetSuite的记录的浏览器在NetSuite的帮助文档。

Here is an example of using NetSuite web services in .NET where I load an Opportunity record. The process of loading Employees or other records would be the same. Once you get the basics working read the NetSuite Records Browser document in the NetSuite help.

// create objects for netsuite login
NetSuiteService netsuite = new NetSuiteService();
CookieContainer cookie = new CookieContainer();
Passport passport = new Passport();
RecordRef role = new RecordRef();

// hard code for administrator role 3
role.externalId = "3";

// latest NetSuite web services url
netsuite.Url = "https://webservices.sandbox.netsuite.com/services/NetSuitePort_2015_1";
netsuite.CookieContainer = new CookieContainer();
passport.account = "6669990";
passport.email = "john.doe@stackoverflow.com";
passport.password = "P@SSW0RD!";
passport.role = role;

System.Console.WriteLine("\nLogging into NetSuite ... ");
System.Console.WriteLine("\nUsername: " + passport.email);
System.Console.WriteLine("\nAccount: " + passport.account);

// try loggin into web services
Status status = netsuite.login(passport).status;

if (status.isSuccess)
{
    // read opportunity record id 2236873
    Opportunity oppty = NSFunc.getOpportunity(netsuite,"2236873");
    System.Console.WriteLine("\nNetSuite Login: " + status.isSuccess.ToString());
    netsuite.logout();
}
else
{
    System.Console.WriteLine("\nNetSuite Login: " + status.isSuccess.ToString());
}

使用,而不是比你的Web服务的NetSuite SuiteScript

使用数据可以写SuiteScript(JavaScript)的文件,将它们保存与(.js文件)文件扩展名,并将其上传到NetSuite的文件柜。

Access data using NetSuite SuiteScript instead of web services than you can write SuiteScript (JavaScript) files, save them with (.js) file extension and upload them to the NetSuite File Cabinet.

您的JavaScript(又名SuiteScript)文件将包含常规的JavaScript和将使用您谈谈API函数。有NetSuite的在线帮助中例如SuiteScripts,这里是一个定制记录的页面加载。

Your JavaScript (aka SuiteScript) file will contain regular JavaScript and will use the API Functions that you talk about. There are example SuiteScripts in the NetSuite Online Help, here is one for customizing the page load of a record.

一旦上传到文件柜,你可以创建一个NetSuite的脚本记录并定义脚本将被如何使用,例如文件名,应该使用哪些功能,哪些事件在窗体上应该引起你的JavaScript功能触发(如保存前,保存后)。最后您部署脚本来测试,你可以测试/调试。还有很多更给它,但这应该让你在正确的轨道上。该网站 NetSuiteGo 有大约NetSuite的SuiteScript信息,它帮助我开始吧。

Once you upload to file cabinet you can create a NetSuite Script record and define how the script will be used, for example the file name, which function should be used, which event on a form should cause your JavaScript function to fire (e.g. Before Save, After Save). Last you deploy your script to "Testing" and you can test/debug it. There is a lot more to it but this should get you on the right track. The website NetSuiteGo has information about NetSuite SuiteScript it helped me get started.

祝你好运。

这篇关于如何使用SuiteScript获得模块数据NetSuite的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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