How to pass the environment for the API call dynamically

 let environment = runtime.envType === runtime.EnvType.PRODUCTION ? ‘production’ : (runtime.envType === runtime.EnvType.SANDBOX ? ‘sandbox’ : ”) let response = checkForParameter(environment) ? customersalesforce.syncToSalesForce(combinedResult, environment, accessSearchResult, true) : {};    const SALES_FORCE_API = {             environment: {                 production: {          … Continue reading How to pass the environment for the API call dynamically

Create invoice automatically for shipped quantity of items in SO

define([‘N/search’, ‘N/record’], function (search, record) {     function getInputData() {         return search.create({             type: “itemfulfillment”,             filters: [                 [“type”, “anyof”, “ItemShip”],                 “AND”,    … Continue reading Create invoice automatically for shipped quantity of items in SO

How to use papa parse library

define([‘N/file’,’N/record’,’N/search’,”N/log”,’./papaparse.min.js’],   /**  * @param{record} record  */   (file,record,search,log,pappa)

Convert contents of csv files to Javascript

try{         let csvFile = file.load({id: 873379});         let fileContents = csvFile.getContents();         let dataFile=pappa.parse(fileContents,{           header:true,           skipEmptyLines:true         }).data;         log.debug(“val”,dataFile)           return dataFile;         }       catch(e){         log.error(“Error in getInputData”, e)       }

Post Request Creation

  let request = https.post({                             url: `${SALES_FORCE_API[‘environment’][netsuiteEnvironment][‘endPoind’]}`,                             headers: {                                 ‘Content-Type’: ‘application/json’,… Continue reading Post Request Creation

How to disable standard line level field in NetSuite

  Here is a sample of disabling line fields “Description” and ” Brand” function disableField(currentRec, sublistId, fieldId) {         let sublistObj = currentRec.getSublist({ sublistId: sublistId });         let objColumn = sublistObj.getColumn({ fieldId: fieldId });         if (objColumn) {             objColumn.isDisabled =… Continue reading How to disable standard line level field in NetSuite

Enabling the Gross Profit Feature

To enable the Gross Profit feature: Go to Setup > Company > Enable Features. On the Transactions subtab, in the Sales section, check the Gross Profit box. Enable other features as desired. The Gross Profit feature is not directly dependent on other features, but may have limited utility without them. For example, the following related features can affect user access… Continue reading Enabling the Gross Profit Feature