Function to get the latest currency exchange rate

  /**        * Function to get the latest currency exchange rate based on base currency (HKD) and transaction currency(USD)        * @param baseCurrency        * @param sourceCurrency        * @return exchangeRate        **/       function getExchangeRate(baseCurrency, sourceCurrency) {         try {           let exchangeRate = 0;               let currencyrateSearchObj = search.create({             type: “currencyrate”,             filters:               [                 [“basecurrency”, “anyof”, baseCurrency],                 “AND”,                 [“transactioncurrency”, “anyof”,… Continue reading Function to get the latest currency exchange rate

Error: “Empty invocation target! “

The error “Empty invocation target!” appears when attempting to hide sublist fields in the sales order. Reason: This error occurs because the field is not applied to the sales order form. Solution: To resolve the issue, retrieve the available sublist fields in the sales order and verify whether the field intended to be hidden is… Continue reading Error: “Empty invocation target! “

Add the git card item and details to the sales order item line using script

The following function can be used to add the git card item and details to the sales order item line.    function addGiftCardItemAndSetDetails(salesOrderId, giftItemId, giftDetails) {             try {                 let salesOrder = record.load({                  … Continue reading Add the git card item and details to the sales order item line using script

Apply the gift certificate to the sales order through script

The following function can be used to apply the gift certificate to the sales order through script   function applyGiftCertificateToSalesOrder(salesOrderId, giftCertificateCode, amountApplied) {             try {                 let salesOrder = record.load({                     type: record.Type.SALES_ORDER,… Continue reading Apply the gift certificate to the sales order through script

Auto Generation of document numbers using Advanced Numbering Rule

The Advanced Numbering feature enables to set up of flexible document and transaction numbering for records. With this feature, we can create multiple complex numbering sequences per transaction type, fiscal year, and other selected criteria. Advanced Numbering automatically updates the document or transaction number sequence, for example, when a new fiscal year begins, or you… Continue reading Auto Generation of document numbers using Advanced Numbering Rule

Function to retrieving Available Items in a Bin Using Inventory Balance Search

  /**          * Function defined to fetch all the items available in the bin in the corresponding location using inventory balance record          * @param {Number} bin          * @param {Number} location          * @returns {Object}          */  … Continue reading Function to retrieving Available Items in a Bin Using Inventory Balance Search

Printing Options for Bill Payments – Checks and Vouchers

NetSuite provides different printing options for Bill Payments, allowing users to generate and print checks or vouchers as needed. To Be Printed : Enabling the To Be Printed checkbox on a Bill Payment transaction adds it to the queue for check printing. The transaction will then appear in the Print Checks & Forms > Checks… Continue reading Printing Options for Bill Payments – Checks and Vouchers

Populate the value from linked custom record in invoice PDF

The following FreeMarker code can be used in an Advanced PDF/HTML template to retrieve and display values from a linked custom record on the invoice PDF. <#assign customRecord = record.custbody6>    <#– Fetch the value from the custom record –>    <#assign customFieldValue = customRecord.custrecord126>    <table style=”width: 100%; margin-top: 10px;”>    <tr><td class=”addressheader” colspan=”3″><b>Subsidiary Bank Account Details</b></td></tr>    <tr> <td><b>Bank… Continue reading Populate the value from linked custom record in invoice PDF

Trigger workflow state or Action

Triggers a workflow on a record. The actions and transitions of the workflow are evaluated for the record in the workflow instance, based on the current state for the workflow instance. Returns the internal ID of the workflow instance used to track the workflow against the record. var workflowInstanceId = workflow.trigger({ recordId: ‘5’, // replace… Continue reading Trigger workflow state or Action