Pre 2009.2, transferring inventory quantity from one location to another via SuiteScript can only be done through inventoryadjustment. First you have to add quantity to destination location.
xfer.setLineItemValue("inventory", "item", 1, ITEM_ID);
xfer.setLineItemValue("inventory", "location", 1, LOC_DESTINATION);
xfer.setLineItemValue("inventory", "adjustqtyby", 1, "5");
Then you have to deduct the quantity from the origin location
xfer.setLineItemValue("inventory", "item", 2, ITEM_ID);
xfer.setLineItemValue("inventory", "location", 2, LOC_ORIGIN);
xfer.setLineItemValue("inventory", "adjustqtyby", 2, "-5");
Putting it all together, the code will roughly look like this:
Continue reading ‘SuiteScript: Inventory Transfer via Code’
NetSuite’s Field Help is a small pop-up window that displays a brief description of the field associated to it. To open it, simply click the field label.

Continue reading ‘Show Field’s Internal ID’
All of a sudden, our users complained that one of our NetSuite process failed. They reported this error:
TypeError: Cannot call method “getTime” of null (some_code.js$sys#791)
I tried to debug the code using nlapiLogExecution can still couldn’t locate where the error occured. I up the ante by using the script debugger and found that the error happens because the code is trying to call the getTime of a null object. Pretty self explanatory, but why did it happen? The code roughly looks like this:
var billDateStr = rec.getFieldValue("custrecord_billdate")
var billDate = nlapiStringToDate(billDateStr);
var billTime = billDate.getTime();
Continue reading ‘New Implementation of nlapiStringToDate in 2009.2′
One feature I like most in Visual Studio 2003 is their Document Outline Panel. I usually abuse this feature on my JavaScript code to easily see and jump through my functions.

Continue reading ‘Document Outline for Client Script in Visual Studio 2005′
Before having my own domain for my blog, I was a huge fan of Yahoo! 360. I love its simplicity and its integration with other Yahoo services. But my enthusiasm slowly faded since Yahoo decides to pull the plug on Y360. Then I found WordPress and I fell in love again. Now my major problem is how do I migrate all my Y360 entries into WP? The most obvious solution is to manually copy all my Y360 entries and paste it to WP one by one. If your post has comments and tags, you should do the same if you want it completely “save” the entry. But what if you have over 50 entries in Y360 with more than 20 comments each? What a nightmare.
Continue reading ‘Import Yahoo! 360 Blog To WordPress’
It was my long standing problem when querying the latest history of a record. The scenario is that I have a parent table and its transaction log (say, history records) are stored in a child table linked by the parent’s primary key id. The parent table stores the main information regarding a transaction while the child table stores historical data of what happened in the parent’s table info.

Continue reading ‘Querying the Latest Record’
I downloaded a very cool theme for this blog and luckily, I successfully installed it in my local instance of WordPress. Satisfying the OC in me, I immediately do some minor twicking to further personalize my page. I tested the page’s comment engine, posting, plugin and widget capabilities but was repeatedly bombarded with this error every time I click a button that causes the page to reload:
Warning: Cannot modify header information - headers already sent by (output started at / my_site/wp-content/themes/new_theme/functions.php:2) in /my_site /wp-includes/pluggable.php on line 694
Continue reading ‘PHP: Cannot Modify Header Information’
Having years of background developing applications using MSSQL Server as the database, I encountered a roadblock when my stored procedure is required to return the id for my newly created row in oracle.
Immediate Work-Around
Since all my tables have a timestamp field, the most obvious thing to do is to query the topmost row of my table sorted by the timestamp field. For added accuracy, I also filtered my query against the userid which created the affected row.
Continue reading ‘Returning the ID of a Newly Created Row in Oracle’s PL-SQL’
If you’ll ask all the ASP.Net developers on what control they want Microsoft to create and include freely, I bet that Tab Control is in the top 5 list. Well, now our dreams finally came true. With the released ASP.Net AJAX last January 2007, the ASP.Net AJAX Team included 4 new controls that are not in their RC1 and Tab Control is one of them (others are AutoComplete, Calendar, MaskedEdit).
Now I am currently involved in a web application development that is deeply in need of tab-based navigation to greatly improve the page’s user friendliness. We downloaded and installed that AJAXToolkit from ASP.Net site, plugged it in one of your page, provided it’s required and necessary properties saved the file and refreshed the page. Our fingers were crossed with be waited for the progress bar to reached it’s maximum length and after the page was rendered, this is what we saw.
Continue reading ‘Tab AJAX Control Toolkit Style Problem’
I was coding with breeze rendering my tabular data with the use of a GridView control. I successfully bound it to my ObjectDataSource and the data were displaying just fine except for one minute problem. My DateTime column was rendered as “raw” format from my SQL Server. This means that my date column displays “8/12/2006 11:47 AM”.
Using my experience from DataGrid control from my ASP.Net 1.1 days, I immediately set the value of my DateTime column’s DataFormatString property to “{0:d}” (short datetime format). I saved the page and refreshed the browser finding my DateTime column still displaying the same “raw” format. What seems to be the problem?
Continue reading ‘DataFormatString For DateTime Column’