In NetSuite, the Time-Off Management feature, part of the SuitePeople HR module, allows businesses to manage employee leave policies effectively. Below is a concise explanation of time-off plans, their setup, terms, and time-off rules in NetSuite terminology, tailored for someone new to the system who needs to study and teach others. Time-Off Plan A time-off… Continue reading Time of management in NetSuite and their key terms
Category: Suite scripts samples
All the samples related to suite scripts.
suiteQL query to get the customer payment application details
This SuiteQL query returns the invoices to which a customer payment was applied. SELECT Invoice.TranID AS InvoiceID, REPLACE( BUILTIN.DF( InvoiceMainLine.CreatedFrom ), ‘Sales Order #’, ” ) AS SONumber, Invoice.OtherRefNum AS CustomerPO, PTLL.ForeignAmount AS AmountPaid FROM Transaction AS Payment INNER JOIN TransactionLine AS PaymentLine ON ( PaymentLine.Transaction = Payment.ID ) AND ( PaymentLine.MainLine = ‘F’ )… Continue reading suiteQL query to get the customer payment application details
Yielding In suiteScript
In SuiteScript 2.x, yielding is primarily associated with Map/Reduce Scripts and, to a lesser extent, Scheduled Scripts for managing governance limits and processing large datasets efficiently. Below is a focused explanation of yielding in SuiteScript 2.x, including how it works and how to implement it. Yielding in Map/Reduce Scripts Purpose: Map/Reduce Scripts automatically yield to… Continue reading Yielding In suiteScript
Approve custom record using suitescrip
In NetSuite, the N/action module’s action.find function is used to locate a specific action (e.g., a custom button, workflow action, or standard action) on a record. This is particularly useful in Client Scripts or Suitelets when you need to dynamically check if an action exists or retrieve its details before performing operations, such as enabling/disabling… Continue reading Approve custom record using suitescrip
Calling Back end suitelet from User event
UserEvent: let recordId = scriptContext.newRecord.id; let billObj = toGetBillingScheduleDetails(recordId); let domain = url.resolveDomain({ hostType: url.HostType.APPLICATION }); var suiteletPath = url.resolveScript({ scriptId: ‘customscript_jj_sl_assignresourcetotask’, deploymentId: ‘customdeploy_jj_sl_assignresourcetotask’, returnExternalUrl: true }); let fullUrl = ‘https://’ + domain + suiteletPath; var response = https.post({ url: suiteletPath, headers: { ‘Content-Type’: ‘application/json’, ‘User-Agent’ : ‘Mozilla/5.0’ }, body: JSON.stringify({ billObj }) }); log.debug(‘Suitelet… Continue reading Calling Back end suitelet from User event
SuiteQL query to get company contacts
The SuiteQL query below returns all of the contacts associated with a specified company. SELECT Company.ID AS Company, Company.EntityTitle AS CompanyName, CompanyContactRelationship.Contact, BUILTIN.DF( CompanyContactRelationship.Contact ) AS ContactName, CompanyContactRelationship.Role, BUILTIN.DF( CompanyContactRelationship.Role ) AS RoleName FROM Entity AS Company INNER JOIN CompanyContactRelationship ON ( CompanyContactRelationship.Company = Company.ID ) WHERE ( Company.ID = 2707 )
SuiteQL query to get the Customer Deposits
This SuiteQL query below returns all deposits received for a specific customer. SELECT Transaction.ID AS Transaction, Transaction.TranID, Transaction.TranDate, BUILTIN.DF( Transaction.Entity ) AS Customer, BUILTIN.DF( TransactionMainLine.CreatedFrom ) AS SalesOrder, Transaction.ForeignTotal, BUILTIN.DF( Transaction.PaymentMethod ) AS PaymentMethod, Transaction.OtherRefNum, BUILTIN.DF( Transaction.Status ) AS Status FROM Transaction INNER JOIN TransactionLine AS TransactionMainLine ON ( TransactionMainLine.Transaction = Transaction.ID ) AND (… Continue reading SuiteQL query to get the Customer Deposits
SuiteQL query to get the item’s price level history
The query given below will give an item’s price level history. It is queried using the InvtItemPriceHistory table. SELECT BUILTIN.DF( PriceType ) AS PriceType, Version, Quantity, Price, Discount FROM InvtItemPriceHistory WHERE ( Item = 1223 ) ORDER BY PriceType, Quantity, Version
SuiteQL query to get the get an item’s price information
The query below will return all price levels for which the item has a set price. It does not include price levels for which the item doesn’t have a price specified. SELECT BUILTIN.DF( Pricing.PriceLevel ) AS PriceLevelName, Pricing.PriceQty, Pricing.UnitPrice FROM Pricing WHERE ( Pricing.Item = 1223 ) ORDER BY PriceLevelName, Pricing.PriceQty
API call a RESTlet endpoint using SuiteScript 2.0 from a client script
let response = https.post({ url: `/app/site/hosting/restlet.nl?script=${SCRIPT_ID}&deploy=${DEPLOYMNT_ID}`, body: JSON.stringify({}), headers: { ‘Content-Type’: ‘application/json’ } });