Browsed by
Category: Netsuite Tips

Live Chat Using Netsuite as Backend

Live Chat Using Netsuite as Backend

This time I decided to practice my skills by creating a simple live chat messaging system with Netsuite as backend and Bootstrap/jQuery as frontend.

I only used one custom record with 3 fields. Two fields (Timestamp and User) were set to default to current user/current datetime. So really the only field I had to write to was the message text.

The messages are sent via POST. I am using the jStorage jQuery library as a local DB to cache the messages. Messages are cached for 60 seconds by default.

The suitelet is being polled every 2 seconds. Every time the suitelet is polled a search runs that returns the last 20 messages created within the last 30 seconds. Clientside code checks for new entries in the db and if new entries are found the messages are displayed.

 

Here’s the code:

 

Integrating Shopify Private App with Netsuite

Integrating Shopify Private App with Netsuite

I couldn’t find this in the shopify documentation so I thought it would be helpful to share it.

Backstory:
I was trying to get the JSON from Shopify Private App and I was getting this error:

[API] Invalid API key or access token (unrecognized login or wrong password)

After much research all I needed to do was add header “X-Shopify-Access-Token”.

Here’s the code, just make sure to replace HTTPSMODULE or load with the Netsuite https Module.

Loading custom HTML and bootstrap within a Suitelet Form

Loading custom HTML and bootstrap within a Suitelet Form

I want to share this nice hack I created to allow to run custom HTML within a Netsuite form. I am using it to load bootstrap and sweet alert, but it can be used for a lot more! In this example I am loading a basic bootstrap template, it can be tweaked to send POST messages to the suitelet and load more jQuery plugins and scripts.

The end result:

SuiteletHackBootstrap

 

Note: This is a hack, so beware.

Leave a comment if you liked it or think it can be improved!

Suitescript 2.x version

 

Suitescript 2.1 version