Netsuite has recently released a new version of their php toolkit (version 2012.2). It looks like they did a pretty big rewrite of a lot of the code. For those of you familiar with the old version of the toolkit, this is good news. I haven’t had a chance to look it over yet, but it looks to be promising. You can check out the office page here.
Recently someone asked me if I could send them a copy of the XML that gets sent back and forth when you make a Netsuite API call. This could be useful if you want to implement the Netsuite API in a language that they don’t provide libraries for. Anyway, here is the xml:
This xml was generated using the PHP_Toolkit and a modification of this test script.
If you want to see the xml from your own requests generated using the PHP Toolkit, just create a folder called “nslog” in the root directory of the toolkit. Then all requests and responses will be logged to that folder. Be careful though, it will fill up fast.
Although I have posted many code samples on this site, I have rarely included a fully functional script. Often login information or execution code was not included since it wasn’t relevant to the particular post. However, here is a complete script that will fetch a record and then var dump it.
Although this may seem useless, its a very handy script. Before saving my own object to Netsuite, I often load one and var_dump it so that I can understand it’s structure.
Here is the code:
//Values you MUST change
$accountNumber = '1111111';
$roleNumber = '1';
$pass = 'yourNetsuitePassword';
$email = 'yourEmail@domain.com';
$id = 111; //must be a valid internalId
//Values you may have to change
$recordType = 'nonInventoryResaleItem';//Change if you want
$myNSclient = new nsClient(nsHost::live);
$ref = new nsRecordRef();
'internalId' => $id,
'type' => $recordType
$readResponse = $myNSclient->get($ref);
Assuming you set the values correctly, this script should be functional. You should see a large amount of output that will either be an error report from Netsuite or the object you requested (wrapped inside a read response object). Its worth noting that this script is designed to run on Linux, so the #!/usr/bin/php would not apply to users of other operating systems.
Today we are releasing a JQuery plugin we have written under an open source license (MIT). It is a small plugin that makes an input harder to edit. Although this may seem counter productive, it is acctually quite useful for forms where you don’t normally change certain fields. Consider a form that allows you to edit a product. Chances are you will never change the serial number of the product, but you want to allow the user to change it just in case something was mistyped the first time. This plugin allows you to do just that. It prevents you from accidentally modifying it, but still makes it easy to change. It will also prevent an input from being “tabbed” to.
If all you want to do is prevent a user from changing a field, you can use the “readonly” attribute. However, this plugin is great for situations where you want something to start readonly, but still be editable if the user is sure they want to change it.
I just tried installed BlueProximity on Ubuntu 12.04. Although it works pretty well, there was a pretty funny glitch. The GUI to configure blueproximity only showed up on the first launch. After that the window didn’t show up. It seemed to be not running. However, a quick “ps -e | grep “blueproximity” revealed that it was in fact running. As it turns out, if the .blueproximity folder is present in your home drive, the program won’t run the configuration GUI. To fix this problem, simply remove the folder (rm -r ./blueproximity), but be aware that this will lose your current configuration.
We recently moved some of our APs to a new subnet on our network. Although desktop and laptop computers were unaffected by the change, all Android smart phones refused to work. Although they could connect to the network, they couldn’t access the Internet. After trying many different things, I finally realized it was a DNS problem. Our DHCP was serving up several name servers. The first two were local DNS servers which (to the best of my knowledge) are working fine. However, the Android phones were not resolving host names. Although the DHCP was offering more name server, it appears that Android devices only pay attention to the first two. By moving up an external DNS server to the second spot in my DHCP I was able to fix the problem. However, it would be nice to know why it didn’t work in the first place.
Today I received the following email from Google stating that someone had tried to log into my account and Google correctly noticed it was suspicious. Someone was trying to log into my account from a city I have never visited. I am quite impressed that Google caught the attempt and stopped it. Congrats Google on keeping my account safe for me! Its always nice to see a computer company going above and beyond to protect their users.
(some content removed below for privacy.)
Someone recently tried to use an application to sign in to your Google Account, **email@example.com. We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:
Friday, July 20, 2012 6:20:55 AM GMT
IP Address: **remoteIP**
If you do not recognize this sign-in attempt, someone else might be trying to access your account. You should sign in to your account and reset your password immediately. Find out how at http://support.google.com/accounts?p=reset_pw
If this was you, and you want to give this application access to your account, complete the troubleshooting steps listed at http://support.google.com/mail?p=client_login
Exporting data to a simple CSV file has provided me an array of problems.
The problem: In every exported .csv file the first row of the document was blank and then the data started in the second row. The methods I used were:fopen, fputcsv, fclose to put the data into a csv file and setHTTPHeader with renderText and file_get_contents to export the file for a download. I tried testing if the loop index was off and was creating the problem but it was not the case. I also tried making sure I was not inserting any newline characters to the csv file.
The solution: After trying to debug every step, I have realized that the problem was caused by having an extra two lines at the end of the php file in which the download was called. After doing more testing, I realized that it only worked for me if there was a blank line and then the ending ?> for my program to work. Make sure there is a blank line before your PHP end tag and also make sure there are no blank lines after it.
After many hours of programming, we are proud to announce the release of our updated website. We have been working on a number of changes and improvements for our site so we are excited to see them finally go live. Among other things, we shifted the site to the Symfony Framework. So far we have been quite happy with the Symfony Framework and it looks to make future changes much easier.
When I was trying to burn a new copy of the latest version of Ubuntu, Brasero was getting stuck on the “Creating Image Checksum”. My first thought was to disable the check-sum feature (which you can do via the edit > plugins), but that did no good. Then Brasero got stuck on “preparing to write”. Finally, I tried running Brasero from the command line using “brasero -g”. This spits out lots of debug info. It turns out brasero was waiting for the cd drive to be ready. Apparently some other program was holding some sort of lock on it. However, a simple restart fixed the problem.