/** * function to validate the email list. * * @param {string} emailList – Comma-separated list of email addresses * * @returns {boolean} – Return true if the email list is valid */ function isValidEmailList(emailList) { if… Continue reading Validation of email address in script
Tag: script
How to Compare Objects with same format
The object must be same with key and their length. const compareObj = (body, ccObject) => { try { if (JSON.stringify(body) === JSON.stringify(ccObject)) return true; … Continue reading How to Compare Objects with same format
How to add value in the existing object
let body = { “type”: “OUTBOUND”, “details”: { “urgent”: false, “arrivaldate”:… Continue reading How to add value in the existing object
How to set up the inventory based on quantity
let finalQuantity = billObj.itemsListPO[lineNumber].quantity; let inventoryDetail = vendorObj.getSublistSubrecord({ sublistId: ‘item’, fieldId:… Continue reading How to set up the inventory based on quantity
Send Email Action Throws a UNEXPECTED_ERROR Details: An Unexpected SuiteScript Error Has Occurred
Select Edit on the affected employee record Enter an email for the employee record Click Save
How to render the transaction as PDF and get the PDF as Base64 encode format
let transactionFile = render.transaction({ entityId: parseInt(internal id of the transaction) printMode: render.PrintMode.PDF, … Continue reading How to render the transaction as PDF and get the PDF as Base64 encode format
How to pass parameters to suite let page by using HTML
<body> <div class=”button-container”> <form action=”#” method=”post”> <input type=”submit” value=”Logout” onclick=”logout()”> </form> </div> <script> function logout(){ alert(“You have been logged out.Please login again!”); window.open(” URL of the suitelet page which you need to open when click logout button”); window.close(); window.history.forward(); var formData = new FormData(); formData.append(‘logoutId’,true); … Continue reading How to pass parameters to suite let page by using HTML
How to create alert based on suitelet button in suitelet page
Here, we just show the alert and moving back to the previous page. function alertExpense(scriptContext) { try { let html = ‘<script>alert(“Please add expenses before submit.”);window.history.back();</script>’; scriptContext.response.write(html); … Continue reading How to create alert based on suitelet button in suitelet page
Function to fetch Url Components of the Custom Record
/** * To fetch Url Components of the Custom Record * @param {*} url * @returns */ function extractRecordInfoFromUrl(url) { try { … Continue reading Function to fetch Url Components of the Custom Record
Script Deployment Updates
Updating a script deployment in Oracle NetSuite is done either through the Deployments sublist on the script record or by directly editing the script deployment record. It’s essential to understand that the method you use may vary depending on the type of script you’re working with. Some script types like portlet, RESTlet, Suitelet, and user… Continue reading Script Deployment Updates