Netsuite has released their 2013_1 version of their PHPToolkit (php library for accessing Netsuite Backend API). Since I had last looked into their toolkit, the Netsuite developers have completely rewritten their toolkit, so I thought I should mention some of my thoughts on the new version:
The Good Stuff
- Object Orientated. The new toolkit makes much better use of objects. Rather than one object (nsComplexObject), there are now objects for logical units like “items” or “customers”.
- Easier to Explore: It is now easy to see what properties an object has. You used to have to look at the webservices documentation to see what properties an object had (and what name they used). However, now you can just look at the php object’s properties.
- Some backwards compatibility: they created a method called setFields() which allows you to set object values via arrays like the older toolkits. A nice touch to reduce code rewriting.
- More Support: now there are more objects and properties accessible via the API
The Not So Good Stuff
- Not backwards compatible: I had to rewrite almost every call to the Netsuite API. The old methods of using the toolkit are broken. The setFields method is nice, but is still used differently than the old toolkit.
- setFields() fails to handle nullFieldList — Looks like a simple bug in the code (not hard to fix though).
- Not namespaced: The toolkit defines hundreds of objects with names like “Customer”, “Item”, and “Task”. Chances are pretty good that at least one of these names will cause a collision. Note: the toolkit does check for existence of a class before defining their own, but that prevents the use of their class. Namespaces would be a much cleaner solution.
Overall I would say the change is for the better. There is still work to be done, and it would have been nice if there was more backwards computability, but overall the change is a good one.