Showing posts with label NetSuite. Show all posts
Showing posts with label NetSuite. Show all posts

Wednesday, August 24, 2011

Do you really need Advanced Billing Module?

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

Lately I've been pondering on this question. I have this task that I need to do where I must figure out billing that fits the business requirements.  It's not a simple requirement and there are many different variables on how the monthly or annual invoice is generated.

I think for most subscription based and/or fixed amount based businesses, billing is pretty straight forward. However, what about those businesses who has fairly complex process?

As I read through NetSuite documentation and posts on Forums, NetSuite provides out of the box feature for reoccurring billing process. They call it "Memorize Transaction" feature. It allows you to replicate reoccurring billing by having NetSuite "Memorize" this instance of transaction and direct it to run it on schedule of your choice. Sounds pretty simple right?
This will work as long as the items included in the invoice doesn't change or no adjustment is needed for the duration of the billing AND you don't mind making adjustments manually from time to time.

We also have NetSuites' paid featured called Advanced Billing Module  I have not used it before and my opinion on this module is purely based on documentation provided by NetSuite. It seems to offer great automation and customization features than "Memorize Transaction" OOB feature. I really like the fact that it will customize billing schedule with initial amount, initial payment terms, recurrence frequency, recurrence count, in arrears, and recurrence payment terms. It definately allows businesses to take control of billing schedules.

But, does it solve the issue of varying amount invoicing? Say like cell phone billing which is based on base amount plus additional overage charge or hourly consultants billing where invoice amount is based on hours worked by the consultants? Can Memorize Transaction or ABM fully automate the process of billing for these situations?

My initial thought is no.

Ofcourse, in order to automate this type of invoicing, you need to identify and create variables that will allow custom process to calculate the correct amount.

I am thinking that for consistently varying monthly or annual invoice process, custom solution will fit better.
Sure this costs money. Most likely more than what you'll pay for ABM. However, what I like to suggest is that before you purchase ABM I think it'll be worth while to revisit the billing business requirements.

What are your thoughts?

Sunday, August 14, 2011

Streamlining the Business Process in NetSuite

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

Lately, all I hear in the news is "Down grade in credit rating", "Recession" or "High unemployment rate". You most likely know them by heart by now. As a business, all these negative economic news would mean tightening the budget belt and trying to figure out where to cut cost.

If your company is using NetSuite or any other SaaS based CRM/ERP tool, this is a good time to revisit all the business processes you have implemented using the system.

I always like to say that tool itself will not save company money or enhance productivity. It's how you use the tool that will get you there. (Obvious point I am making....)

Types of business process I am referring to:

  • Lead to Customer process.
  • Drip email marketing process.
  • Sales order processing.
  • Billing process.
  • Customer relation process.
List goes on... 


Here are some things to look for when you are revisiting your business processes.

  • Process flow diagram:
    Have you created process diagram for each of your business processes used in the System? If you don't have it, you really need to create one. Directors and Project Managers can tell you everything about what the processes are but it's worth nothing when the system doesn't reflect them.
  • Identify automation points within the process
    Use the tool to do the work for you. There are some steps in the process where human intervention is inevitable but there are overlooked steps that doesn't require it. Making sales calls to customers most likely will not be a good candidate for automation but starting a drip marketing campaign is.
    Here are something that I can think of to automate using NetSuite:
    - Auto generation of Sales Order, Proposals or Invoices
    - Conversion process
    - Record creation process
    - Ongoing billing process
    - Subscription renewal process
    - Daily accounting process
  • Identify unnecessary or potentially new steps
    If you already have process diagrams for each of the business processes, revisiting them will give you a fresh look.

    For some departments or projects, business requirements change frequently. This will give you a chance to compare with current requirements and remove or add in steps you no longer need. This will better streamline the process.
Perhaps it's not your job to do this type of work. If you are NetSuite Admin or developer, does this SOUND like your job description? Probably not. But wouldn't you want your company to save money and keep providing the things you enjoy???

Tuesday, August 2, 2011

Couple things NetSuite Documentation Doesn't Tell You

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

NetSuite most likely doesn't care what I complain to them about. I'm no body. I'm just a guy trying to make in this world.

However, I think these two items they may listen and PUT it on the documentation or make it more clearer.

Point 1: Check out customization URLs
There is ONLY ONE usable checkout URL in Sandbox Environment. That is https://checkout.sandbox.netsuite.com. All other selections are used ONLY for production.
I came across this issue while making our second webstore in Sandbox. When ever we refresh our Sandbox from Prod, this error occured. I initially thought it was just a flook. However, when second brand new Webstore I started on began to throw "Page Not Found" or "Internal Server Error" with other customizable check out URL, that's when it got me concerned.

Point 2: Domain IS required to be able to use Descriptive URLs
I'm sure some of you already knew this. I couldn't find anything on documentation about this specific statement. However, If you are having issues with Descriptive URL you set up for Items and Presentation Tabs, you need to set up your own domain.

CORRECTION:
Apparently, Point 2 is wrong on my part. You can find it under this Path of documentation:
Web Site : Searching & Search Engine Optimization : Search Engine Optimization (SEO) : Setting Up Descriptive URLs


It says:
To use descriptive URLs in NetSuite, first, set up a domain at Setup > Web Site > Set Up Domains. Next, turn on the Advanced Site Customization feature, and the Descriptive URLs feature at Setup > Company > Enable Features, on the Web Presence subtab. 

Saturday, July 30, 2011

Webstore Main Menu Customization

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

Who uses out of the box template for website any more? If you are using NetSuite Advanced Site Customization, you have the option to custom build the main navigation bar.

I've seen some posting on NetSuite Forum where fellow NetSuite users were asking for ability to build out dynamic menu system on their Webstore without heavy scripting. I am one of them.
Standard "Tabs" just doesn't do justice for my brilliant site layout. (I'm seriously being sarcastic here...)

So, how do you build this in WITHOUT heavy scripting? Well... unfortunately, you still need to do SOME scripting but method I found seems to work out without too much headache.

For my little project, I wanted to build dynamic horizontal menu layout.

In NetSuite, you can use <NLPAGETABS> to generate he horizontal tab menu layout. If you sue this tag nested between <table> and </table> tags in Logo and Tabs Template section under Body tab of your Theme.
As long as you have your tabs marked as "Show on Website", that one tag will render everything for you.

Here is sample menu tree I wanted to achieve:
Home page Products (Presentation Tab 0) Shopping Cart My Account
  Product Page 1 (Presentation Tab A)    
  Product Page 2 (Presentation Tab B)    
  Product Page 3 (Presentation Tab C)    

When visitor mouse over to Products, I want three sub pages to show up. As noted above, each page is a presentation tab with different items. 

If you were to ONLY use out of the box <NLPAGETABS>, those sub pages will get rendered as main navigation and will NOT look good.

Here is how I implemented dynamic custom main menu:
Step 1: Find the script you like.
I found a very handy, easy to use dynamic menu from Dynamic Drive. The script I found is very simple and not much modification is needed. Details of this script can be found here. Be sure to read their Terms of Use before using it. =)
I made some modifications to the CSS file to match the theme of my website. 

Step 2: Upload script files, CSS files and any images to your NetSuite Document folder.
What ever file you decide to use, you need to first upload it to your documents folder to be referenced on your Webstore. Script that I found from Dynamic Drive is fairly small and simple which I really like.

Step 3: Implement. (This is implementation using the Script from Dynamic Drive)
  • Make sure .js and .css files are referenced at the Header. [Your Theme] > General > Additon to <head> section.
Go to [Your Theme] > Body > Logo and Tabs Template section and add in your navigation.
Code Sample:
Main Navigation Code:
<div class="chromestyle" id="chromemenu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#" rel="dropmenu1">Products</a></li>
<li><a href="#">Shopping Cart</a></li>
<li><a href="#">My Account</a></li>
</ul>
</div>
** red="dropmenu1" indicates a reference to sub menu items.
Sub Menu Navigation Code:
<div id="dropmenu1" class="dropmenudiv">
<a href="#">Product Page 1</a>
<a href="#">Product Page 2</a>
<a href="#">Product Page 3</a>
</div>
Script Tag:
** Add this after you've placed all your menu item
<script type="text/javascript">
cssdropdown.startchrome("chromemenu")
</script>

You can customize it further to your liking. Please read the details on Dynamic Drive regarding this script.

It's not that bad. I changed the CSS just a bit to match my pages' colors and didn't touch the original script file. 

If you'd like to see this page in action, please contact me by email. mhson1978@gmail.com

Oh yah, one note. If you customize the navigation this way, URL to pages will be a bit hard to manage. I've been looking into using Descriptive URL feature but its not working for me at the moment.
I've done some research on the Forum and some one DID say this:
You must have domain set up in order to use it.
I've actually asked my network admin to put in a CNAME for me. So if it works, I'll let you guys know.

Let me know if you have any questions. NetSuite, do you guys know when you'll add this as Part of NetSuite feature?

Wednesday, July 27, 2011

Steps to setting up your customized Invoice Template

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

This came as shock to me. I had issues finding different templates for setting up my custom invoice.
I broke my #1 rule of how to become NetSuite Guru. Did you click on the link? Well, #1 rule is to read the documentation and I did NOT on this particular case. =(

After doing some manly hunting work, I've figured out the mapping on custom invoice template. For us, we needed to include remittance slip on every invoice. Guess what, this is actually one of the feature you have to enable. (Again. READ YOUR DOCUMENTATION!!!)

If you are in the market to do such thing, here is how you enable remittance form with invoices:
Setup > Company > Printing, Fax & Email Preferences
- Check the box next to "Print Remittance Form with Invoices & Statements"

Here is how you set up your customized invoice. You kinda have to go backwards on this and here is why. When setting up your actual invoice, you supply templates for PDF layout, HTML layout and Remittance Slip.  Unless you plan to use Standard versions, you want to create custom versions of them.

Step 1-HTML Layout Template:
Go to Setup > Customization > Transaction Form HTML Layouts
- Select from different types of "Transaction" forms at your disposal to Customize.
- Provide custom HTML layout for your invoice under Templates Tab.
- You can customize HTML for specific NetSuite Tags under Elements tab.
- Save as "My Invoice HTML Layout" (This is a free country. You can name it what ever you want)

Step 2-PDF Layout Template:
Go to Setup > Customization > Transaction Form PDF Layouts
- Select from different types of "Transaction" forms at your disposal to Customize.
- Move things around, adjust the font size, text box etc.
** I found PDF layout customization somewhat difficult to work with. Just my $0.02
- Save as "My Invoice PDF Layout" (Again, name it what ever you want)

Setting up Remittance Form:
If you don't need to do this, you can skip this section but if you need to "customize" Remittance section, you may want to read on.

I don't know about you but for us, we needed to add text not available through NLATTRIBUTES. It had to be customized to look like our legacy invoice format. HTML version of Remittance form wasn't a problem because NetSuite provided highly flexible "TEXTAREA" to write our own HTML. However, PDF version... well, that was different story. Extremely customization UNFRIENDLY!!!!!

Step 3-HTML Remittance Form Template:
Go to Setup > Customization > Transaction Form HTML Layouts
- Select from different types of "Remittance Slip" forms at your disposal to Customize.
- Provide your custom HTML for remittance area of your invoice.
- Save as "My Invoice HTML Remittance Layout" (... Last time... Name it what ever you want)

Step 4-PDF Remittance Form Template:
Go to Setup > Customization > Transaction Form PDF Layouts
- Select your poison from "Remittance Slip" forms to Customize.
- Move things around, set up the way you want it to look in PDF.
** DO KEEP IN MIND, I found it Extremely difficult to customize this since only limited fields are at your disposal to display.
- Save as "My Invoice PDF Remittance Layout"

Step 5-Remittance Template Wrapper:
Go to Setup > Customization > Transaction Forms
- Select from different types of "Remittance Slip" forms to Customize.
- For PDF Layout, select "My Invoice PDF Remittance Layout" or what ever you named it on Step 4.
- For HTML Layout, select "My Invoice HTML Remittance Layout" or what ever you named it on Step 3.
** Quick Note: **
If you write ANYTHING on Disclaimer textbox, you can get to it by using the tag <DISCLAIMER>. However,... as I noted above, PDF is VERY VERY limited when it comes to providing free text. I actually used Disclaimer box to enter in my free text. I'm sure it's not recommended but this was the only way I found to enter in Free-Text.  IF you are doing what I did, be sure to do following:

  • Never use <DISCLAIMER> tag on your HTML template. Since HTML template is more flexible when it comes to free text, you can write it out.
  • Move things around on your PDF layout so that disclaimer box appears in different way.
  • IMPORTANT: Disclaimer and Address textarea are NOT HTML enabled. If you type HTML, it'll get parsed as regular text 

- Finally save this as "My Remittance Template Wrapper"

OK! You are now ready to create your own Invoice Template!

Step 6-Create Custom Invoice Template:
Go to Setup > Customization > Transaction Forms
- Select from different types of "Invoice" froms to Customize.
- For PDF Layout, select "My Invoice PDF Layout" or what ever you named it from Step 2.
- For HTML Layout, select "My Invoice HTML Layout" or what ever you named it from Step 1.
- For Remittance Slip, select "My Remittance Template Wrapper" or what ever you named it from Step 5.
- Save as "My Custom Invoice Template"

Now you see what I mean by going backwards?

Once you've set this up, you can choose your custom invoice from Sales Order templates to be used.

Here are some things that I found Important:

  • You need to set up EVERYTHING before you can TRUELY customize the look and feel. From the most parent level, you can provide different fields to be shown which can in turn be accessed by child forms.
  • From Customer Center, one you choose as default will be used for PDF layout. (If anyone from NetSuite can correct me on this, PLEASE DO!)
  • You CAN override Print in PDF by going to Home > Set Preferences > Transactions Tab and Setting "Print Using HTML" check box. However, THIS seems to be user based rather than Global setting.
Hope this helps... 

Tuesday, June 21, 2011

NetSuite Support Case - Grab Notification

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

Have you ever received an email from NetSuite Support saying something the line of "Hello, My name is [Rep. Name] and I will be working on your case..."

We wanted to do something like this for our support. Thought it was pretty nice way to let folks know that they are not being ignored. After some research, we find out that this isn't an automated solution.

Apparently, NetSuite Support implemented this method by attaching a solution to a case and having it notify customer. When Solution is attached to the case, they manually enter in Case Number and their name before sending it.

I thought this was a bit odd. Apparently, using CRMSDK Tags do not work when added to a solution set. So, I've been thinking about a work around for this. I haven't tried it yet but I'm sure it'll work.

First, create yourself a solution called "Case Assignment". Here is an example:
Hello, My name is [RepName] and I'll be working on your case #[CaseNumber].
Second, create a script file which will be deployed at Case form level or Case Record level.
My thought is that my script will fire ONSAVE or right before the form is submitted.

If the value of the INSERTSOLUTION field is "Case Assignment" AND value of OUTGOINGMESSAGE contains the value [RepName] or [CaseNumber] {
Replace [RepName] with Currently Logged in User's first and last name;
Replace [CaseNumber] with getFieldValue('CASENUMBER');
}

What do you think? I think this might work. I'll let you guys know as soon as I put it in. Working version of the code coming soon.....

Thursday, June 9, 2011

IE Annoyance - "Do you want to Only show secure elements?"

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

I got nothing against Internet Explorer but this is really annoying. Have you ever come across websites where you get system popup window asking you permission to display non-secure elements on secure website? going from IE 7 to 8, they changed the message of popup. With IE 7, it used to be something in the line of "Do you want to display both secure and non-secure elements?". With IE 8, they changed it to "Do ONLY want to display secure elements?" With IE 9, it now displays a notice message that looks like part of website at the bottom center.

Dear Microsoft, stop confusing people and start helping people!!!!

How does this apply to us NetSuite folks? You guys might already have fix for this on your webstores but I just recently found this as an issue.

If you are like me, you are most likely using small part or all elements of jQuery. You may also use external form to process customer registration data.If this is you, you may have come across this IE annoyance during your cross browser testing.

What does this error mean? Well, simply put, your URL is https:// but content of the page contains none https elements. Most likely it'll be reference to external image, javascript and css.

Solution? Tell your customer to read the message before clicking.

Better solution? Change reference to these elements to https.
Every time you upload a script or an image to NetSuite, you will notice that NetSuite provides you with several different URLs for your uploded items.

I just realized why they provide these. It's to help you avoid IE's confusing messages. =)

Go to Documents in your NetSuite account and drill down to folder you uploaded your item. Click on Edit to view details of that items you'll notice these different URLs.

Hope this helps... if not, hope I've given you something to laugh about.

Tuesday, June 7, 2011

How to become a NetSuite Guru

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

This is just my opinion but I think I'm starting to see a pattern on how to to become true NetSuite Guru. I'm sure I have a right to say this since I have such knowledge and experience on working with NetSuite. (I'm being really sarcastic here. I don't have long years of experience and I am not a NetSuite Guru. It's my way of making a joke).

  1.  Read NetSuite documentation.
    I admit, I haven't read topic in NetSuite documentation. I get lost reading accounting and financing topics. I should have paid more attention in College. It really helps to know where to go for help. I see lot of people jumping the gun and asking people but if you  read the documentation answers are there. It also allows you the ability to find what you are looking for quickly.
  2. Expand your knowledge of relational database.
    You may disagree with me on this but I feel that it really helps if you have understanding in this area. Custom records is nothing but database tables. Creating and defining relationships between custom records and native records allows you to build better forms and business processes.
  3. Become an expert on HTML, CSS and JavaScript
    If you are doing any kind of customization, you need to know these three technologies. Form customizations, business process customizations and webstore customizations all depends on these three technologies and it will make your life easier as a developer.
  4. Know what is available out of the box as well as online public bundles.
    I think this goes with point #1. There are times when you get lost in joy and high of customizing NetSuite. However, beware of over customization. There are things that are readily available for you out of the box. You don't have to build something from ground up. There are also free bundles you can download and customize to your need.
  5. Understand the business needs.
    With NetSuite, I think it's very important that you understand organizational goal as well as each departments needs. NetSuite is just a tool.
  6. Atleast have an understanding of NetSuite process.
    You don't have to be an expert in project management or accounting or finance. As long as you understand how NetSuite processes them, you can build or configure based on expertise provided by your organizations' department experts.
  7. Study, Practice and Participate
    I've been hearing alot of negative feedback on NetSuite lately. and I have one thing to say to all Nay Sayers. No matter what cloud platforms you go with, if you don't take time to learn the product you are a lost cause. Always study up on features and unknown features of NetSuite, always practice different methodologies and always participate in user forums. 

Saturday, May 28, 2011

Alternate more efficient way to Debug Webstore Scriptable Cart

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

Recently, I had a nice email conversation with Jason K. from NetSuite. He thought my workaround for debugging scriptable cart/checkout was very clever. It means alot coming from him. However, he actually came up with even better way of debugging scriptable cart/checkout. Jason, you are the MAN!

His method resolves the issue of eating away at script metering in my version of workaround. Using nlapiRequestURL() eats 10 governance from allowance and it causes issue during form testing. He also mentioned something very important as well. With v2011.1, NetSuite relaxed the rules on type of Sales Order form that can be used for scriptable cart/checkout. This means, you are not restricted to using External Sales Order. You can customize Standard Sales Order and use it for the scriptable cart.

Here is how you go about doing this: Thank you Jason K. for coming up with this workaround!

Step 1: Create custom sales order forms for both Invoice and CashSales from standard invoice sales order and standard cashsale sales order.
Setup > Customization > Transaction Forms
** Make sure you do NOT put anything under custom code tab for both forms!!!
After you create the two new forms, make a note of their Internal IDs. You will need them in step 2.

Step 2: Create alternate version of your scriptable cart script. Keep currently working version as your backup. You may need it.
At the top of every event functions, add following line of code:
if (nlapiGetFieldValue('customform') != '[InternalID of SO Invoice from Step 1]'
&&   nlapiGetFieldValue('customform') != 'InternalID of SO CashSale from Step 1') {
  return;
}
This ensures that script only fires for the sales order forms you are using on Webstore.
Make sure every time you want to print debugging message, you use nlapiLogExecution() call to do so.

Step 3: Create new "Client Script" file and deploy it for all Sales Order.
Creating new script file: Set > Customization > Script > New > Client Script
Don't for get to fill out all your event functions and attach any library scripts. Deploying this script for Sales order is up to your preference. I usually do "Save & Deploy".
When you are deploying your client script for sales order, make sure list of audience includes Customer Center and perhaps most obvious thing, make sure it Applies to Sales Order.

Step 4: Attach newly created Sales Order forms to your webstore
Setup > Web Site > Set up web site. 
Under the Setup Tab > Preferences section, select new invoice sales order for Scripting Template (Invoice) and new cash sale sales order for Scripting Template (Credit Card).

That's it! To view execution logs, you can to go Script or Script Deployment record and click Execution Log tab.

Hope this works out for you guys. Thank you again Jason K for this workaround!

Wednesday, May 25, 2011

Best Browser for NetSuite? - Post by Rob MacEwen from Audaxium

Check out this blog entry from Audaxium by Rob MacEwen. I personally like using Chrome and Firefox for development purposes. Chrome definitely seem to be more responsive compared to IE and Firefox.

For development, I almost always use Firefox. Their Firebug work far better in Firefox than Chrome. I hate to "Hate" on IE but I only use them to test cross browser compatibility for Webstore customization. 

Best Browser for NetSuite?

Getting Started with Pardot API in NetSuite

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

Who is using Pardot for Email Marketing Automation? I don't directly work with Marketing Department to know ins and outs of Pardot but I do know it's pretty awesome email marketing automation tool. I've seen my Marketing department create very effective unmanned drip marketing campaign through Pardot's automation workflow. Like every online software though, it's not perfect. However for what it's used for, I think it's pretty great software.

They have API available so that other cloud based or home grown software can connect and integrate.

As a developer, what does Pardot API mean? It means more work ;) No, no, it actually means you can take your website to new level of integration. Automated drip campaign based on activity your website visitors are doing? Access prospects information such as past activities, scores and display different sales related result pages? Well, I'm sure your marketing department can come up with pretty fancy way of using it.

Let's start with the basics. Pardot's API is URL based. I found it pretty easy to use when integrating NetSuite and Pardot together. You can check out Pardots' API documentation.

I wrote about NetSuite - Pardot Integration before

Step 1: You need to be able to get Authenticated into Pardot.
Pardot API on Authentcation
Pardot URL: https://pi.pardot.com/api/login/version/3
Required Parameters: Email Address, Password, User Key
Request sent to Pardot using GET or POST method will return API Key if login was successful.
In NetSuite, you can use nlapiRequestURL() method to make a server call out to external webservices.
var loginUrl='https://pi.pardot.com/api/login/version/3?email=[pardotEmail]&password=[pardotPass]&user_key=[pardotKey]';
var authorizeResponse = nlapiRequestURL(loginUrl,null,null);
var xml=nlapiStringToXML(authorizeResponse.getBody());
Javascript variable xml will contain result xml from Pardot. If successful, it will contain API Key. If unsuccessful, it will contain error code.

Step 2: Use the API Key to perform actions against Pardot.
Once you have the API Key, you can perform actions against Pardot. User Key and API Key are fundamentally required parameters. Most of my actions were against Pardot prospects so below are my most widely used API URLs:
  • Prospect Search:
    https://pi.pardot.com/api/prospect/version/3/do/read/output/full&user_key=[x]&api_key=[x]...
  • Prospect Add:
    https://pi.pardot.com/api/prospect/version/3/do/create/output/full&user_key=[x]&api_key=[x]...
  • Prospect Update:
    https://pi.pardot.com/api/prospect/version/3/do/update/output/full&user_key=[x]&api_key=[x]...

You can get pretty creative once you know the basics of how to use Pardot API. As I mentioned before, if your company is using NetSuite along with Pardot, it'll be extremely useful to create Pardot related library script.

As I mentioned before, you can use Xpath to gain access to response XML from Pardot. With Pardot API, you can;
  • Create or Update Prospects
  • Search for existing Prospects
  • Add/Remove Prospects from Marketing Segmentations
  • Add/Remove Prospects from Marketing Campaigns
  • Access native and/or custom Pardot fields
I have one last thought. Both NetSuite and Pardot used together can be very powerful tool for your organization. If you lack in technical resources or you need to get something off the ground fast, do consider using external resources. One company in particular who's been great help is Audaxium. They specialize in MS Dynamics, Pardot and NetSuite integration. Understanding the integration points between the two system and know what it can and can not do is critical to your business.

Tuesday, May 24, 2011

Advanced Webstore Item templates

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

I learned something cool last night. Do join me in celebrating my slow learning process of NetSuite.

Did you know you can set custom drill down webstore template at an individual item level?


Route I took to customizing look and feel of our webstore is to take a pre-designed template from NetSuite and modifying it. I can set default product drill down template for both Welcome and Product layouts.
For most folks, product drill down template doesn't have to be "Special", but for me, it had to be special. Especially when item options varies and you have to apply special validations against it.

If items in your webstore requires special attention for item detail page, definitely look into using this.

Try to abstract out different types of item detail page you'd need and group them together. When you create your drill down templates, it'll be based on these grouping.

You can gain access to creating different templates by going to Web Site Item/Category Templates page.
Setup > Web Site > Item/Category Templates


You can set individual drill down template per item by following these steps:

  1. List > Accounting > Items > Select the webstore item you wish to add custom drill down template
  2. Click on Store or Webstore tab. (This depends on the item you've selected)
  3. Next to "Item Drilldown Template", select your newly created template
  4. Save
It's a small things that makes me happy these days. This saved me from coding different javascript validation for each items with varying item options.



Saturday, May 21, 2011

Helpful JavaScript functions you may want to include in your Library Script

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

We all need help sometimes. For me, I am not ashamed to look for help on the NetSuite Forum. Through out my experience with NetSuite deployment and customizations, I've found following JavaScript functions to be extremely helpful and I hope it provides you with some help as well.

Contains function: I found this script from CSS-Tricks website.
It is most useful when you have array of objects, strings, numbers and you wish to check for existence of a value you pass it.
Array.prototype.contains = function(arg) {
  for (i in this) {
    if (this[i]==arg) return true;
  }
  return false;
};
Here is how you use it.
var myArray = new Array("123","555","888","999"); //internal id of items
var itm = nlapiGetCurrentLineItemValue('item','item'); //get item id of current line item
if (myArray.contains(itm)) {
  alert('This Item exists in the Array!');
}
It makes your code lot simpler and easy to read.

Empty filter value checker: While writing custom search, I came across some odd errors here and there. Turns out, when search filter value is null or empty, it throws an error. After reading documentation, it turns out that you have to use @NONE@ in place of empty or null value.
function emptyFilterCheck(_val) {
  if (_val) {
    return _val;
  } else {
    return '@NONE@';
  }
}
 Send Email Function: I'm sure most of you have this function separated out. This is my version of the send email. It takes 6 parameters. From ID, To ID, Subject, Message, Attach to Record ID, Record Type.
Script will attach email to a record if the value is passed in.
function sendNotificationEmails(fromId, toId, strSbj, strMsg, attachToRecId, recType) {
  //check for sandbox
  if (env == 'SANDBOX') {
    strSbj='[SANDBOX] - '+strSbj;
  }


  try {
    //attach this email to record if defined
    if (attachToRecId != null) {
      var rec = new Object();
      if (recType==null) {
        rec['entity']=attachToRecId;
      } else if (recType=='transaction' || recType=='activity') {
        rec[recType]=attachToRecId;
      } else {
        //This is custom record
        nlapiLogExecution('DEBUG','msg','This is custom record:');
        rec['recordtype']=recType;
        rec['record']=attachToRecId;
      }
      nlapiSendEmail(fromId, toId, strSbj, strMsg, null, null, rec);
    } else {
      nlapiSendEmail(fromId, toId, strSbj, strMsg);
    }
    return true;
  } catch(e) {
    if (e instanceof nlobjError) {
      //Do your error handling here for e.getCode()and e.getDetails()
    } else {
      //Do your error handling for JavaScript issue: e.toString()
    }
  }
}
There are few others I'm trying to put it. Just to give you an idea, here are list of potential helper functions I am creating:

  • Search function which takes array of filter fields, values, and records' internal ID.
    I found myself writing these codes over and over again.
  • Specialized Pardot API library sets.
    If you use Pardot along with NetSuite, it's a good idea to create common function calls to Pardot. For example, LookupProspect(email), AddOrUpdProspect(email, JSONfldValObj), UpdProspectList(email, newList), UpdProspectCamp(email, newCampaign), GetActivities(email) just to name a few.
    I plan to write some sample Pardot API calls from NetSuite that I've written later.
  • Sublist related functions. 
What are some of your helper functions you are using?

Saturday, May 14, 2011

How to debug Netsuite Webstore Scriptable Cart

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


Notice:
Blogspot had issues with their server and post I originally wrote got deleted. I do apologize for missing link:

Important Update on this Post: 5/17/2011:
nlapiRequestURL() eats up API Governance meter by 10 points. Testing on External Form, if you have this turned on, you only have 1000 limit. On Webstore, you seem to have 2147483647. Don't ask me where that number came from.

So, Here I go again. How DO you debug scriptable cart executing on webstore? The script itself is attached to the External Sales Order form you create which implies is client level script. You can't use Firebug to step through it either.So how do you debug when your script is not returning the results you want?

I began using this workaround and it has helped me alot.
Workaround: Create Suitelet (Available without Login) to track printing of debug messages and call it using nlapiRequestURL() from your scriptable cart script.

Write Suitelet Script: Save as "sl_writelog.js" and push out to Netsuite 
** Please note, for simplicity, I've written my script to use GET event.
function slExecLog(request, response){
  if (request.getMethod() == 'GET') {
    var log = filterUserInput(request.getParameter('log'));
    var title=filterUserInput(request.getParameter('title'));
    writeLog('DEBUG',title,log);
    response.write('called back');
  }
}
Deploy your script:
  1. Login to Netsuite and go to Setup > Customization > Scripts > Click New
  2. Select Suitelet as script type
  3. Provide Name and ID for this script.
  4. Under Scripts tab, select "sl_writelog.js" for Script File and "slExecLog" as Function
  5. Select "Save and Deploy" option.
  6. Provide Name and ID for this script deployment
  7. Check "Available Without Login" 
  8. Select GET Request as Event Type.
    If you choose to use Post, you should change your script to check for POST and also select POST Request as Event Type
  9. Under Audience tab, select "All Roles"
  10. Save
Once you've deployed your script, copy the External URL for this deployment. According to NetSuite documentation, nlapiRequestURL() does NOT send User Session information. 

Link to your Suitelet from Scriptable cart script:
Open your scriptable cart script and create a function which will call your suitelet. This is how I did it:
Please note that anything enclosed in [ and ] is to be replaced by your code including the brackets.
function wslog(_txt) {
  if (!_txt) {
    return;
  }
  var loginUrl = '[External URL for your Suitelet]&title=[Value of title]&log='+_txt;
  if (wsdebug) {
    nlapiRequestURL(loginUrl, null, null);
    return;
  }else{
    alert(_txt);
  }
}
You will notice above that I check for wsdebug value. This is global boolean value I created so that I can turn on/off calling of my debug suitelet.
When I'm testing on the form, I set this value to false so that I can see the alert messages. Testing/deployment on webstore, I set this value to true.
Check your debug messages:
Once everything is doen, go to your Webstore and add items to your cart so that your scriptable cart script will fire.
To check the log messages, open your Suitelet script record and click on Execution Log.


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!

Friday, May 6, 2011

Separating Name field to First and Last Name in NetSuite Webstore

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

NetSuite, I have bones to pick with you! Why would you just put Name field on e-commerce registration form? WHY???!?!?!?!

Well, until they put in a fix for it, I do have a work around for those who wish to use it.
If you have already customized your webstore, most likely you have script files you are placing on the header of your web site theme.

For this purpose, create a new JavaScript file. For now create a function called checkPage().
function checkPage() {
}
 Save and load it to your live hosting folder and place a reference to it at the header of your website theme.

Append functions to body tag:
Open your theme by going to Setup > Website > Theme > [Your Theme]
Under General tab, please reference to your new javascript file on "Addition to <head>".
Also under general tab, append your new function call next to "page_init()".

Your body tags' onload call should look like this: onload="page_init(); checkPage();"

Doing this will call your checkPage() every time different sections of your webstore is loaded.

Finding field info:
The name text box should have id and name of "name".

Sudo Coding:
What we wanna do is this:
1. Find name text box and do the following:
- Change type from text to hidden
- Clear onfocus and onchange. This may not be necessary
2. Create first name text box element
- Add id of fname (your choice)
3. Create last name text box element
- Add id of lname(your choice)
4. Place the two elements where original name text box was
5. Write validation script to check for missing values for the two.
6. IF validation passes, set the value of now HIDDEN name field with first and last name provided. (VERY IMPORTANT STEP)

Lets add the meat to our script:
I found that registration page has specific form called "newcust". Checking for existence of this form will be our queue to begin our modification process.
Oh BTW, if you know jQuery, more power to ya. It'll be much easier

Here is the code:

function checkPage() {
//find out if registration form exists
var regform = document.forms['newcust'];
if (regform !=null) {
var ntx = regform.name;
ntx.setAttribute('type','hidden');
ntx.onfocus='';
ntx.onchange='';
//get span node that wraps name text box
var cellspan = ntx.parentNode;


var fnamebox = document.createElement('input');
var txtNode = document.createTextNode(' ');
var lnamebox = document.createElement('input');
fnamebox.setAttribute('type','text');
fnamebox.setAttribute('id','fname');
fnamebox.setAttribute('onfocus',"txtChange('fname','First Name');");
fnamebox.setAttribute('onblur',"txtChange('fname','First Name');");
fnamebox.value='First Name';
lnamebox.setAttribute('type','text');
lnamebox.setAttribute('id','lname');
lnamebox.value='Last Name';
lnamebox.setAttribute('onfocus',"txtChange('lname','Last Name');");
lnamebox.setAttribute('onblur',"txtChange('lname','Last Name');");
cellspan.appendChild(fnamebox);
cellspan.appendChild(txtNode);
cellspan.appendChild(lnamebox);
}
}


//just helper function to switch between default values.
function txtChange(_id, _text) {
var el = document.getElementById(_id);
if (el && el.value == _text) {
el.value='';
}else if(el && el.value=='') {
el.value=_text;
}
}

This should do it. You just need to now add validation script (Sudo code step 5 & 6) for onsubmit.
If validtion passes, you can do something like this.

var fname=document.getElementById('fname').value;
var lname=document.getElementById('lname').value;
document.getElementById('name').value = fname+' '+lname;

This isn't the only way you can do this. I just wanted to show you guys that it IS possible to do this.





Friday, April 29, 2011

NetSuite - Scripting/Debugging Tips I've learned so far

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

NetSuites' SuiteScript is JavaScript based language which allows developers to really get down and dirty with truly customize NetSuite.

Like finger prints, not all businesses are alike. NetSuite tries pretty hard to meet the requirements of each and every businesses that are out there but it's an impossible task. That's why they have SuiteScript to build out your own, business specific customizations.

Here are some tips on scripting/customizing/debugging that I've picked up so far:
  1. Download and install Chrome or FireFox. JavaScript Debugger, Firebug is a must have tool. It allows you to set break points so that you can successfully debug your custom scripts.
  2. Take advantage of NetSuite Debugger. This is really good for unit testing your code. Write snippets of your code and execute it on NetSuite Debugger and verify your script behaves properly.
  3. Abstract out common functions and create utility script. I'm sure everyone is already doing this. I mean who really wants to write out nlapiLogExecution or nlapiSendEmail?!?!?!!?! Way too long!
  4. Unless you HAVE to... avoid using nlapiLoadRecord. If you are doing simple field value search or field updates, nlapiLookupField and nlapiSubmitField will do just fine. Only time I found myself using nlapiLoadRecord is when I had to drill down to sublists. I'm really hoping NetSuite will come up with function to do just this
  5. For Webstore customization, get to know what IS customizable. I recently had to customize login pages text and links on our Webstore. It turns out, all the text and links are customizable through Setup > Website > Customize Text
    If you are going to use Webstore, it really REALLY helps to purchase Advanced Web Module. 
Ok.. That's what I have so far...  

Tuesday, April 26, 2011

NetSuite - Pardot Integration

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

Couple weeks ago, I saw a quick post on NetSuite's fan page on Facebook on Pardot. For those of you who are not familiar with Pardot, they are marketing automation provider. It's pretty awesome tool for Marketing department.

Pardot offers OOB, easy setup to connect with either NetSuite. It offers connectors for other CRM tools as well. Here is a catch; you can only connect to ONE CRM tool. It makes sense. First of all, you wouldn't want to have multiple CRM ran within your company. That's serious waste of money.

Anyway, one issue that I found with NetSuite connector; while it works well with minimum setup effort, it is highly limited in customization. Pardot set the ground rules how leads/customers/prospects will get synced between the two system and you really don't have much say in it.
I have submitted an enhancement request for this with Pardot but it's not really going anywhere.

What is an alternate solution? You can take advantage both NetSuite and Pardot API to sync between the two system. It takes some work Pardot API is available

When you look at NetSuite documentation, you will see nlapiRequestURL() method call. You can use this to connect out to Pardot API. You can use nlapiStringToXML() to get response body back and convert it to XML and from there you can get any values you want out of it.

YOU DO NEED TO KNOW XPath. You can get a quick tutorial from W3Cschool

Pardot API documentation has good amount of information on getting up to speed on using API usage.

I think this method is far less intrusive compared to OOB Pardot to NetSuite connector and you have full control over what information comes back and go out.

One Note: You will need to use this as Scheduled Script in NetSuite and from time to time, you will get following errors from Pardot:
  • Invalid API Key
  • Request Time out.
  • Exceeded Time out.
It happens from time to time. Nothing serious to worry about. Just make sure you code accordingly.
Happy coding!

Saturday, April 23, 2011

NetSuite - Things I've Learned So far... The "GOT YA"!

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

I've been working with NetSuite for little over a year now. Yes, not much of experience to be writing Blog about it. I do consider myself as NetSuite Newb so don't hate.

Anyway, I've compiled some list of things I've learned so far.

  1. Rev. Rec. Schedule, Product and Department from items are not automatically pulled over to Sales Order when an item is purchased from the Webstore.
    > NetSuite claims to have the Product/Department issue fixed in 2010.2 but I'm not seeing it.
    Work around: Created after submit User Event script against a Transaction type to set these info manually.
       
  2. Item Groups are NOT allowed to be sold in the Webstore.
    This became a big issue for us because Item Group was the one that you can pick and choose which items you want to sell as a group and still have taxes applied at individual component level. We sell that exact product type and it does NOT allow to be sold in the Webstore.
    >I believe there is enhancement request out there for this and I am hoping that it'll be put in soon.
    Work around: Scriptable cart/check out. Keep in mind, I believe you need to have advanced webstore module for this work for ya. My work around was to sell Item Kit (not taxlable) and using scriptable cart/check out, dynamically added Taxable item to the cart. This was pretty tricky putting in but it works like a charm.
  3. Don't trust workflow. Yes. most of you may disagree for I've seen forum posts raving reviews on workflows. It doesn't work for me. =(
    >Issue #1: No way to properly debug workflow. Yes, you can set it in test mode but it's very difficult to see what actually is going on at each step.
    >Issue #2: Not enough documentation.
    >Issue #3: What is UP WITH SET FIELD VALUE not working.
    Work around: If you must use workflow, my suggestion is to use it in conjuction with form level client script.
  4. You only get 12 Sandbox refresh per year.
    Ok, I think this is an extreme newb mistake. No one really said anything about it and the customer service never mentioned it when we requested refresh. We had many in the beginning.
  5. SuiteScript is a gift and a curse. It lets you customize to your hearts' content but yet so confusing to keep track of it all. 
Ok.. I'm done bitching about it for today. Need to get some work done. 

Tuesday, April 5, 2011

NetSuite Webstore - Customization at a high level

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

For the past months, I've been thinking through how I can customize the Webstore registration process. Essentially, out of the box (OOB) Netsuite webstore functionality is some what limited in my opinion when it comes to being able to customize the registration process. Don't get me wrong, I think NetSuite does pretty excellent job in allowing users to customize their ERP System to the max but still Webstore lacks the ability.
The limitation I speak of is the fact that NetSuite allows registration even if customer already exists in the system. I found that there isn't really an easy way to customize this  process where it will maximize the user experience while reducing duplicate entries in the system.
So, how do you get around this? The latest NetSuite version (2011.1) doesn't include this capability and believe me, there are enhancement requests logged by other customers of NetSuite. I've been browsing the NetSuite forum diligently and found a work around. It's not a simple process.
Here is what you need to have in order to properly customize the registration/login process of your NetSuite Webstore which will reduce duplicate entries.
  1. You must have Advanced Webstore module. 
  2. You must have advanced knowledge in JavaScript and SuiteScript Frame Work.
What I would like to do here is give you the core steps so that you can implement your own process. 
Best way to go about this is to replace existing OOB registration with your own Custom Customer Form. In the forum, folks suggested that you disable customer registration or simply ONLY allow registered user to access Webstore. By setting this option, you remove the OOB registration form.
Using Advanced Web Module template, manually add in a link to your Custom Customer Form(s). 
One major draw back to this method is that you need to recreate the website look and feel on to each custom form you create. However, major bonus is that you can customize it to your hearts content!
Keep these in mind:
  1. Using custom form, you can take advantage of NetSuites' dedpublication method. It's somewhat limited but this may work out for you. 
  2. Using Custom Customer Form(s), you can create somewhat of workflow process by linking forms together. You can do this by setting options of (Redirect page after submit). Just remember this, SUBMIT action on these forms WILL generate a lead so DEFENITELY use NetSuites' OOB deduplication process. Work around to this would be to use AJAX Scripting combined with public Suitelets to interact with NetSuite backend.
  3. Have clear workflow defined. Basically, know what you want your customers to go through.
There are two websites that I found extremely helpful in seeing how customization can be accomplished:
They are both great demonstration of what you can accomplish. 
This maybe old news for some of you but this was great insight for me. =)
Here are posts Webstore Customization topics you maybe interested in: