This article is relevant if you are seeking to modify NetSuite’s customer center environment and you find NetSuite’s Help documentation insufficient.
NetSuite Customer Center Elements
The NetSuite Customer Center is a limited role offered to help your customers see their transactions and manage preferences. The trick to making it behave they way you want is to understand where the defining elements live in the NetSuite system. Most of this is documented well in NetSuite help. However, here are a few key areas which are less obvious.
- View Transaction Forms: Normally, the way you manage the look and feel of your transaction forms is to edit ‘(External)’ definitions. However, NetSuite does not use this definition for view mode. Instead, it uses the “Printing Fields” definition of the preferred internal transaction form related to how the transaction was initially created. To get control over that layout, you modify the internal definition of preferred form; not the “(External)” form.
- (External) Form Definitions: To clarify the previous point, the (External) form definitions are used only for Customer Center driven Create and Edit functions.
- Scripting Capacities: Scripting in the customer center environment is limited. However, you can insert a javascript definition in the Head area of the page by going to the Site Builder, Web Site Setup, Analytics area. Remember, you may need to have make your script wait until the page is fully loaded before you can perform you script enhancements. Scripts defined here are not SuiteScript; instead, they are standard DHTML.
Defining a Custom Login Page
The trick is to understand how to craft the form post to NetSuite. We used this idea on a recent Magento to NetSuite integration where we wanted customers to go to the NetSuite Customer Center to see order status but we wanted the primary visual experience to be driven from Magento.
Here is a sample form post HTML:
<html> <head> <script> //utility script to parse the URL elements used in the body function getURLParameter(name) { return decodeURI( (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] ); } </script> </head> <body> <!-- you will need to get your specific parameters for customer center by inspecting how NetSuite crafts the URL to your customer center login --> <form method="post" action='https://checkout.netsuite.com/app/site/backend/customerlogin.nl?ck=rPoSA4C-AarqFwj9&vid=rPoSA4C-AQ7rFzQA&cktime=114304&addrcountry=CN'> <input type='hidden' name='c' value='=enter your netsuite company ID here'> <input type='hidden' maxlength=1 name='new' size='1' value='F'> <input type='hidden' maxlength=1 name='review' size='1' value='F'> <input type='hidden' name='forgotPasswd' value='F'> <input type='hidden' name='viewHint' value='F'> <input type='hidden' name='redirect' value='https://checkout.netsuite.com/app/accounting/transactions/transactionlist.nl?Transaction_TYPE=@ALL@'> Username: <input id="retemail" name="retemail" type="text" value=""/><br> Password: <input id="retpwd" name="retpwd" type="password" value=""/><br> <input type="submit" value="Continue" id='submitter' name='submitter'/> </form> <script> //since this page will be hosted by Magento in an IFrame, we want to pass the username //on the URL and jave the user see the his/her name pre-filled in the form. var username = getURLParameter('username'); if (username!='null') { document.getElementById("retemail").value = username; } </script> </body> </html>
Get Help
NetSuite is a powerful platform. Sometimes, it takes a bit of creativity to get NetSuite to do what you want it to do. If you are looking to enhance your NetSuite environment, contact us.