HRIMS Integration API Structure Documentation

Employee Sync The HRIMS will provide GET API End point for fetching the Employee data from HRIMS. We will call from the NetSuite to HRIMS We will send the request on scheduled basis(Daily). We will use the HRIMS Employee ID for detecting the duplication of employees.  The HRIMS must have the same class, subsidiary,department, location… Continue reading HRIMS Integration API Structure Documentation

Prompt using Sweet Alert Library

<!DOCTYPE html> <html> <head>     <title>Sweet Alert Example</title> </head> <body>     <!– Button to trigger the Sweet Alert –>     <button onclick=”showSweetAlert()”>Show Sweet Alert</button>     <!– Include SweetAlert JS –>     <script src=”https://cdn.jsdelivr.net/npm/sweetalert2@11.1.4/dist/sweetalert2.all.min.js”></script>     <script>         function showSweetAlert() {             Swal.fire({… Continue reading Prompt using Sweet Alert Library

Function for Adding or Updating the Employee Address using Suite Script

/**      * Function will Add/Update the Permanent Address      * @param {Object} employeeObj      * @param {Object} createEmployeeRec      */     const upsertPermanentAddress = (employeeObj, createEmployeeRec) => {         try {             if (!checkForParameter(employeeObj[‘PermanentCountry’]) && !checkForParameter(employeeObj[‘PermanentAddress’])          … Continue reading Function for Adding or Updating the Employee Address using Suite Script

Error: [INVALID_KEY_OR_REF] [Invalid Salesrep Reference Key XXX.]

Error Message [INVALID_KEY_OR_REF] [Invalid salesrep reference key Employee_Internal_Id.] The above error occurs if the employee that is being set as the sales rep is not a valid option in NetSuite. In the above error message, Employee_Internal_Id will be the internal id of the employee record in NetSuite that is being set into the sales rep field. Steps… Continue reading Error: [INVALID_KEY_OR_REF] [Invalid Salesrep Reference Key XXX.]

Create Folder using SuiteScript

This shows how to create a folder using SuiteScript /**  * @NApiVersion 2.x  * @NScriptType UserEventScript  * @NModuleScope SameAccount  */ define([‘N/record’], /**  * @param {‌record} record  */ function(record) {‌ function afterSubmit(scriptContext) {‌ var objRecord = record.create({‌ type: record.Type.FOLDER, isDynamic: true }); objRecord.setValue({‌ fieldId: ‘name’, value: ‘Create Folder Test’ }); var recordId = objRecord.save({‌ enableSourcing: true,… Continue reading Create Folder using SuiteScript

SuiteScript 2.0 Error: no method getTime()

To get the date on a date or datetime field from a record such as that of startdate or lastmodifieddate, the string output from record.getValue() needs to be converted first to a date using N/format module’s format.parse() method. require([‘N/currentRecord’, ‘N/format’], function (nCurrentRecord, nFormat) {‌     var currentRecord = nCurrentRecord.get();     var lastModifiedDateString =… Continue reading SuiteScript 2.0 Error: no method getTime()

log.error is not a function in SuiteScript

User encounters the error “TypeError log.error is not a function” using SuiteScript 2.0 script This error usually happens if the script has a custom function named log in the script or libraries which it calls. The solution is to find and rename the custom function from “log” to something else like “logExec”. This is not only applicable to… Continue reading log.error is not a function in SuiteScript

Calculate total from an array of object contains similar items.

Function to find the total from an array of object if it contains similar items. var groupedByItem = arr.reduce(function (result, current) {    var item = current.Item;    if (!result[item]) {       result[item] = {          Type: current.Type,          Item: item,          TotalQuantity: 0       };    }    result[item].TotalQuantity += parseInt(current.Quantity);    return result;… Continue reading Calculate total from an array of object contains similar items.

Proposal for Auto Applying Discount on Drop Ship PO Items

Proposal Summary  This proposal is to display a popup when a Drop Ship Purchase Order is edited. Upon clicking the button within the popup, the system should automatically apply the discount to the Purchase Order.    Requirement  To apply the discount on the line item of Drop Ship PO. A popup needs to display and… Continue reading Proposal for Auto Applying Discount on Drop Ship PO Items