We can pass custom objects, and XML values as data sources to a template instead of a single record data.Use the function TemplateRenderer.addCustomDataSource(options) for this. This is a part of the N/render module and is available for all server scripts(of the 2.x version).The parameters require are: ‘options.alias’ of string type which stores alias for the… Continue reading Add custom values as the data sources to a template
Month: March 2023
How to display a date object as a date value in another timezone
In Javascript, the date object does not store any specific timezone value. The time is stored in the value of the local timezone relative to GMT(Greenwich Mean Time). If we print the time object, we can see that the time is represented as a value with a sign and offset from the UTC(Coordinated Universal Time)… Continue reading How to display a date object as a date value in another timezone
Filter an Item List/Record Custom Field by the Display in Web Site Checkbox
Scenario There is a requirement to filter an Item List/Record Custom Field by the Display in Web Store setting in the Item Record that is enabled. Solution Navigate to Customization > Lists, Records, & Fields > Transaction Body Fields > New Label: Enter LabelExample: Display in Website Filter Type: Select List/Record List/Record: Select Item Store Value: Enter Checkmark Click Applies To Sale: Enter Checkmark Click Sourcing & Filtering Filter Using: Select Available Online Is Checked: Enter Checkmark Click Add Click Save
Add backorder on Packing Slip PDF
Solution A sample Packing slip PDF having backorder field is given below
Add lead details to Klaviyo
Solution We can integrate with Klaviyo and post the netsuite data using their API A sample UE is added below
API and Services Test Automation
API and services test automation involves using tools and scripts to automate the testing of application programming interfaces (APIs) and web services. This type of testing is often used to verify the functionality, reliability, and performance of these critical components of modern software applications. The primary goal of API and services test automation is to… Continue reading API and Services Test Automation
Converting credentials to base 64 formats for the API call (Access token retrieval)
The function converts the string combining the username and password to base 64 format and apply in the API call for generating the access token. Sample API request code snippet let accessTokenresponse = https.post({ url: AUTH_URL, headers: { ‘Content-Type’: ‘application/x-www-form-urlencoded’, ‘Authorization’: ‘Basic ‘ + getBasicAuthorisation(credentialFetch), }, body: { ‘grant_type’: ‘client_credentials’, } }); /** * @description… Continue reading Converting credentials to base 64 formats for the API call (Access token retrieval)
EXPLORATORY TESTING
Exploratory testing is a type of software testing that is often performed by testers with the goal of learning about the software, finding defects, and identifying areas that may require additional testing. In exploratory testing, the tester is given some high-level information about the software under test and is then expected to use their creativity… Continue reading EXPLORATORY TESTING
Function to get the latest currency exchange rate based on base currency and transaction currency
Function to get the latest currency exchange rate based on base currency and transaction currency
Basic Suitelet script structure for uploading a CSV file
We can use the following Suitelet for uploading a file and passing the contents. We can use the contents in the CSV file as per our requirements. We can upload though the UI from the script: Script: