Auto journal creation & application in Payment

Scenario: Create a journal for applying in the credit section of the payment. Ultimate need is to capture the credit info from the custom record, need to create a journal or custom transaction of journal type then apply the same in the payment record.We have seen a limitation of once payment is saved the credit… Continue reading Auto journal creation & application in Payment

Comparing Two dates

Scenario: We have a start date and a Due date and need to a validation where Due date date should be a date after the Start date. Solution: Usually we can use the JavaScript Date() function. But you can’t compare two dates using that. Better approach to make comparison between dates is to use getTime() function. This… Continue reading Comparing Two dates

Script to get the preferred bin and set to a custom column

This script reads and sets the preferred bin to custom column Bin# for the deployed transactions /** *@NApiVersion 2.1 *@NScriptType UserEventScript */ /*** * FLTW-68 Bin Population script Optimization */ define([‘N/record’, ‘N/search’], function (record, search) { function afterSubmit(context) { try { if (context.type !== context.UserEventType.CREATE && context.type !== context.UserEventType.EDIT) // works for create and edit… Continue reading Script to get the preferred bin and set to a custom column

Read value from a JSON Array by referring to another Key’s value JavaScript

Suppose we have an JSON array as below. var details = [ {“name”:x,”email”:”test@gmail.com}, {“name”:y,”email”:”test1@gmail.com}, ] To get Y’s email id use the below function function findElement(arrayName, nameValue) { for (var i = 0; i < arr.length; i++) if (arr[i][“name”] == propValue) return arr[i][“email”]; // will return undefined if not found; you could return a default… Continue reading Read value from a JSON Array by referring to another Key’s value JavaScript

When you can’t add details in every fields in Suitelet

Suitelet scripts can be executed with any client scripts. Sometimes in such situations, the suitlet page(interface) mayn’t be working perfectly. There will be some conditions where some fields may not be working or sometime you can’t enter values to all (necessary) fields. In such situations, output also won’t be perfect. In the client script, almost… Continue reading When you can’t add details in every fields in Suitelet

How to resolve splitting of field data in to two columns when we try to push data to single column in CSV file using Suitescript ?

Scenario : If we use comma as separator when creating CSV file through suite script, Suppose field data contains comma, when we try to push data to a single column in CSV that data will be break at comma and pushed to 2 columns. How to resolve this issue ? Solution : When we get… Continue reading How to resolve splitting of field data in to two columns when we try to push data to single column in CSV file using Suitescript ?

GET transfer Order API Restlet

/** * @NApiVersion 2.1 * @NScriptType Restlet *//** * APP GET transfer Orders * * Get the Transfer orders * .Inventory Transfer Orders with status “Pending Fulfillment” and sourceLocationId = siteId * .Inventory Transfer Orders with status “Pending Receipt” and destinationLocationId = siteId */define([‘N/search’,’./moment.min.js’,’./hs.2x.logger.js’], /** * @param{search} search */ (search,moment,logger) => { let API =… Continue reading GET transfer Order API Restlet

Sample Restlet

/** * @NApiVersion 2.1 * @NScriptType Restlet */define([“N/record”], (record) => { /** * Defines the function that is executed when a GET request is sent to a RESTlet. * @param {Object} requestParams – Parameters from HTTP request URL; parameters passed as an Object (for all supported * content types) * @returns {string | Object} HTTP… Continue reading Sample Restlet

Custom Suitelet for changing the Project Status

This script creates a custom suitelet form with fields project Name, project subsidiary, Current Status, New Status.On selecting the new status from the dropdown field ithe value will set on the project record.and can add this link to the Employee center. /** * @NApiVersion 2.1 * @NScriptType Suitelet */define([‘N/record’, ‘N/redirect’, ‘N/runtime’, ‘N/search’, ‘N/ui/message’, ‘N/ui/serverWidget’], /**… Continue reading Custom Suitelet for changing the Project Status

Download Excel from the custom suitelet page

/** * @NApiVersion 2.1 * @NScriptType Suitelet */ /************************************************************************************************************************* * CLIENTNAME: * AMVOP-117 * Vat Report * ********************************************************************************************************************** * Date 23/07/2021 * * Author: Jobin & Jismi IT Services LLP * Script Description : This Script is to create suitelet page for vat report * Date created : 23/07/2021 * * REVISION HISTORY * *… Continue reading Download Excel from the custom suitelet page