Pages

2013/09/03

Connect your Contact Us Page from your Website to Netsuite

We have previously presented a way to auto-submit a NetSuite Online Customer Form using some javascript code, to send information from your own website to your Netsuite account (http://blog.erpguru.com/2012/01/use-of-online-customer-form-as-url.html).

Since then we have formulated an even easier and cleaner solution,  using a simple http POST request. 

Scenario:  You have a Contact Us page on your company website and you would like to easily connect it to your Netsuite account.  Note : this also works with Infusionsoft generated forms.

Step 1:  Create an Online Customer Form in Netsuite.
Add fields you want to capture in the Fields tab. Ex: First Name, Last Name, Email, Company, Comments.
  
Custom fields are supported; make sure to remember their Internal ID for Step 3.



Setup the form Workflow normally as per your requirements - the most important information is the Redirect to URL, which is the page where the user will land once form is submitted:



Save the form. 


Step 2: Go to the External tab on your form and retrieve the Publishable Form URL:



Copy the Publishable Form URL (here, https://forms.na1....)


Step 3:  Modify your Contact Us page or your Infusionsoft form to POST to the Netsuite form :

Here is a sample of a very basic Contact us page :


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERP Guru - Contact Us example</title>
</head>
<body>

<div class="form_section">
<h2>Send us your comments!</h2>
<form id="myform" action="https://forms.na1.netsuite.com/app/site/crm/externalleadpage.nl?compid=TSTDRV1024319&formid=14&h=dc4352373aa13c3112da" method="post">

First name : <input name="firstname" type="text"><br>
Last name : <input name="lastname" type="text"><br>
Email : <input name="email" type="email"><br>
Company name : <input name="companyname" type="text"><br>
Your comments : <textarea name="custentity_customcomments"></textarea><br>
<input type="hidden" name="subsidiary" value="1">

<input type="submit" value="submit">
</form>

</body>
</html>



When adjusting your page, it’s important to use your fields Internal ID. For example, the Internal ID of the First Name field in Netsuite is firstname. Thus, we use: <input name="firstname" type="text">

As Custom Comments is a custom field in Netsuite, we have to use its Internal ID: custentity_customcomments

Note: Subsidiary field is mandatory for NetSuite OneWorld accounts.  The best is to hardcode it in your page, using a hidden field:
 <input type="hidden" name="subsidiary" value="1">  (1 is the subsidiary Internal ID)


When the form is submitted, the information will be captured in NetSuite and user will land on the Online form Redirect To URL.

Authors :  Felix Guinet and Guillaume Bouchard Lafond

6 comments:

  1. Thanks for the walkthrough. This is a good method to use for people who host their website outside of NetSuite, Or even as an alternate implementation for NetSuite template-driven websites. One downside is that the statistic accounting for number of requests will not be counted, but the submits should be.

    One other caveat is that the coder who builds the form will need to add in any verification, and make sure mandatory fields are submitted.

    ReplyDelete
  2. Hi David,

    Thanks for your comments!

    You are absolutely right about the checks being required in the HTML page, before Netsuite. That shouldn't be too complex for a webdesigner or a guru though.

    Also, it can be seen as a plus for those trying as much as possible to "white label" NetSuite forms when used on their own branded websites.

    Cheers!

    ReplyDelete
  3. Hello,

    Do you know if this method also works for Custom Online Forms (NetSuite online forms that create custom records in NetSuite) ?
    I have tried this and I get an error message from NetSuite that says: Notice Invalid Record Type

    If not, is there another way to connect a web site form to a NetSuite Custom online form?

    Thank you!

    ReplyDelete
  4. Hi Eric,

    Thanks for your question! Like you need the hidden subsidiary field of a Customer, you need the hidden "Record Type" for custom record types.

    Add the following line to your form, where XXX is the internal id of you record type in Netsuite :
    (without //)

    < //input// id = "rectype" type="hidden" name="rectype" value="XXX" //>

    All the props go to Guillaume for this one!

    ReplyDelete
    Replies
    1. Hi Félix!

      Thank you! This has saved me a lot of time!

      Initially, I was entering the custom record id: (ex: customrecord_01). This wasn't working so I entered the record internal id, as you recommended, (ex: 54) and it worked!

      Merci!

      Delete