/** * @NApiVersion 2.x * @NScriptType Suitelet */ define([‘N/crypto’, ‘N/log’], function (crypto, log) { function onRequest(context) { let text = ‘Sample Data’; // Encode to Base64 let encoded = crypto.encode({ input: text, outputEncoding: crypto.Encoding.BASE_64 }); log.debug(‘Encoded (Base64):’, encoded); // Decode from Base64 let decoded = crypto.decode({ input: encoded, inputEncoding: crypto.Encoding.BASE_64 }); log.debug(‘Decoded:’, decoded); context.response.write(‘Encoded:… Continue reading Encoding and Decoding Base64 with the N/crypto Module
Author: Abhishek A K
How to Hash Data in NetSuite Using the N/crypto Module
/** * @NApiVersion 2.x * @NScriptType Suitelet */ define([‘N/crypto’, ‘N/log’], function (crypto, log) { function onRequest(context) { let textToHash = ‘Sample Text’; let hash = crypto.hash({ algorithm: crypto.HashAlg.SHA256, input: textToHash }); log.debug(‘Hashed Value:’, hash); context.response.write(‘SHA-256 Hashed Value: ‘ + hash); } return { onRequest: onRequest }; }); How It Works The crypto.hash() function takes… Continue reading How to Hash Data in NetSuite Using the N/crypto Module
Understanding Sublist.updateTotallingFieldId(options) in NetSuite SuiteScript
The Sublist.updateTotallingFieldId(options) method is used in NetSuite’s SuiteScript 2.x to update the field ID responsible for calculating the total value of a sublist. This is particularly useful when dealing with custom transaction sublists where a total field needs to be dynamically reassigned based on business logic. SYNTAX: sublist.updateTotallingFieldId({ id: ‘total_field_id’ }); Key Use… Continue reading Understanding Sublist.updateTotallingFieldId(options) in NetSuite SuiteScript
List and update the latest Price details in dashboard using Portlet script
Suitlet Script /** * @NApiVersion 2.1 * @NScriptType Suitelet */ define([‘N/log’, ‘N/record’], /** * @param{log} log * @param{record} record */ (log, record) => { /** * Defines the Suitelet script trigger point. * @param {Object} scriptContext * @param {ServerRequest} scriptContext.request – Incoming request * @param {ServerResponse} scriptContext.response – Suitelet response * @since 2015.2 */ const… Continue reading List and update the latest Price details in dashboard using Portlet script
Set Default Value Using Inline HTML Field
Go to Customization: Navigate to Customization > Forms > Entry Forms (or Transaction Forms, depending on the record type). Edit the Form: Select the appropriate form you want to customize by clicking Edit. Add an Inline HTML Field: Go to the Fields tab or section on the form. Add a new field: Field Type: Inline… Continue reading Set Default Value Using Inline HTML Field
What is Credit Note?
A Credit Note is a document issued by a seller to a buyer to formally acknowledge a credit adjustment for goods returned, overcharged invoices, or other reconciliation reasons. It reduces the amount payable by the buyer to the seller. Key Features: Issued by: Seller to Buyer. Purpose: To notify the buyer of a credit made… Continue reading What is Credit Note?
What is Debit Note?
A Debit Note is a document issued by a buyer to a seller to formally request a credit for returned goods, incorrect charges, or other adjustments. It increases the amount payable by the buyer to the seller and is considered an adjustment in the books of accounts. Key Features: Issued by: Buyer to Seller. Purpose:… Continue reading What is Debit Note?
Merging data from multiple custom records
1. Identify the Data Structure Before merging data, it’s crucial to understand the structure of the records and the response format. You need to know: What custom records need to be merged (e.g., GRW007 Work Effort, GRW007 Work Effort Status, etc.) The format of the merged data (e.g., JSON or any other structure) The required… Continue reading Merging data from multiple custom records
Customizing NetSuite Email Templates for Branding
1. Adding a Company Logo The company logo is a key element of brand identity. Upload your logo to the File Cabinet in NetSuite, then reference its URL in the email template. HTML Code Example: <div style=”text-align: center; padding: 20px;”> <img src=”https://yoursite.com/logo.png” alt=”Company Logo” style=”width: 150px; height: auto;”> </div> 2. Using Brand Colors Incorporate your… Continue reading Customizing NetSuite Email Templates for Branding
Understanding HTTP and HTTPS
1. Introduction to HTTP and HTTPS HTTP (Hypertext Transfer Protocol): HTTP is a protocol used for transferring data on the web. It forms the foundation of communication between web browsers and servers. Operates on port 80. Data is transmitted in plain text, making it less secure. Ideal for non-sensitive data. HTTPS (HTTP Secure): HTTPS is… Continue reading Understanding HTTP and HTTPS