Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
webservices integration
here is a sample to login, logout and create a task.
try {
NetSuiteServiceLocator service = new NetSuiteServiceLocator();
service.setMaintainSession(true);
NetSuitePortType port = service.getNetSuitePort();
RecordRef role = new RecordRef();
role.setInternalId("3");
Passport passport = new Passport();
passport.setEmail("test@test.com");
passport.setPassword("testpassword");
passport.setRole(role);
passport.setAccount("TSTDRV123456");
// login
StatusDetail[] status = (port.login(passport)).getStatus();
// create a task
Task task = new Task();
task.setTitle("task 001");
port.add(task);
// logout
status = (port.logout()).getStatus();
} catch (Exception ex) {
ex.printStackTrace();
}