Monday, May 9, 2011

NetSuite - Item Options on Webstore

We've MOVED!!!! www.codeboxllc.com/ksc

I've been over working my brain on trying to dynamically set item options through Scriptable Checkout on the Webstore.

I've search long and hard on NetSuite forum and from what everyone says, it should work. In fact, I've tested out my code on External Sales Order form and It DOES Work. However, when you actually walk through the process of purchasing an item in Webstore, script never fires.

Here is what I did. I believe you need Advanced Webstore Capability

  1. Under Setup > Customization > Transaction Forms, Create two new Sales Order (External) forms; one for cash sales and one for invoices.
  2. Attached script I want to use to each of the external forms I created.
  3. Under Setup > Web Site > Set up Web site > Setup Tab, I set up the following:
    Scriptable Cart and Checkout: Checked
    Scripting Template (Credit Card): Points to Sales Order (External) Cash Sales form
    Scripting Template (Invoice): Points to Sales Order (External) Invoice form
One of the best tip given by NetSuite developer was this:
"Aways test your external form internally before you begin testing on Web Store"
I followed his advice and began testing my code internally. You can do this by going to Setup > Customization > Transaction Forms, and click on one of the external form link; not the edit link but the form name.  This will bring up empty form.

All your function you defined will fire as you fill in the form. By testing the form internally, I saw that Item Options were being set on the item line item.  HOWEVER, same code, same form doesn't behave the same when executed from Web Store.

I'm really hoping SOMEONE FROM NetSuite WILL ANSWER MY QUESTION!!!!!

The Workaround:
If you guys every need to accomplish something like this, my suggestion is to handle it through User Event Script.
I personally set up my User Event to fire on After Submit.

You create your server-side User Event script and deploy it to Sales Order record. You can code your script to ONLY fire when Sales Order is from your webstore. You can do this by checking for "leadsource" field value.

At this point, you gain access to all server-side script including the ability to manipulate the item list.

Some key points to remember:

  1. Any manipulation you do, make sure it doesn't affect what your customer has already provided. Newly Altered version of Sales Order will be emailed to customer. ** If you have it set up that way
  2. NetSuite support indicated that they fixed a bug with Rev. Rec. Schedule not pulling down from Item record. It is STILL BROKEN FOR US! You can get around it by using this script.
If Anyone has a work around for this issue, PLEASE PLEASE message me. I'd love to hear how you got it fixed!

No comments:

Post a Comment