NetSuite OAuth 2.0 Authentication for SuiteCloud Development Framework (SDF)

NetSuite OAuth 2.0 Authentication for SuiteCloud Development Framework (SDF) With the release of SuiteCloud SDK version 2024.2 (or 2.0.0 for @oracle/suitecloud-cli), NetSuite introduces OAuth 2.0 as the new standard for authentication in the SuiteCloud Development Framework (SDF). This update marks a significant shift from the previous methods of Browser-Based and Token-Based Authentication (TBA). Transition from… Continue reading NetSuite OAuth 2.0 Authentication for SuiteCloud Development Framework (SDF)

Payload Startup File for the Plesk Panel

Here is the startup file which can be used for the startup file import express from ‘express’ import payload from ‘payload’ import path from ‘path’ import nodemailerSendgrid from ‘nodemailer-sendgrid’ const sendGridAPIKey = process.env.SENDGRIDAPI_KEY require(‘dotenv’).config({ path: path.resolve(__dirname, ‘../.env’), }) const app = express() const PORT = process.env.PORT || 8000 // Redirect root to Admin panel app.get(‘/’,… Continue reading Payload Startup File for the Plesk Panel

https.post() method

When you need to send an HTTPS POST request synchronously in NetSuite, the https.post() method is the appropriate choice. This method is designed for scenarios where you require the script to wait for the completion of the HTTP request before proceeding. Example: let response = https.post({ url: url, headers: { ‘Content-Type’: ‘application/json’ }, body: JSON.stringify({… Continue reading https.post() method

Resolving the “elem._marshal is not a function” Error in NetSuite

Error Message: “elem._marshal is not a function” This error typically occurs when a script expects a certain data type (e.g., a string or a single value) but receives a different type (e.g., an object or an array). Common Scenario This error can happen while using the search.create function in NetSuite. It occurs when a parameter… Continue reading Resolving the “elem._marshal is not a function” Error in NetSuite

Form.clientScriptModulePath function

Form.clientScriptModulePath function is the relative path to the client script file to be used in this form. Use this property when attaching an on demand client script to a server script. General syntax is as: objForm.clientScriptModulePath = ‘SuiteScripts/formBehavior.js’; Note that the path to be mentioned is the relative path of the file. It is useful… Continue reading Form.clientScriptModulePath function

Custom and basic RMA table infrastructure

Update API Data { rma_id customer_id: dealer_id: status: order_id: po_number: memo: pdf: items:{ { product_id: qty: }, { product_id: qty: } } Create API Data { customer_id: dealer_id: status: order_id: po_number: memo: pdf: items:{ { product_id: qty: }, { product_id: qty: } } Two tables has bee created jj_rma and jj_rma_items. Main table should contain… Continue reading Custom and basic RMA table infrastructure

Option to delete customers account from the Myaccount

A delete button has been placed on the account custom template on the extension JJ_Account. On the delete a controller action is called on the Ajax method. $(document).on(‘click’,’.delete-contact’, function () { var email = $(this).data(“email”); swal.fire({ title: “Are you sure?”, text: “Do you want to delete?”, icon: “warning”, showCancelButton: true, confirmButtonColor: ‘#9FC33A’, cancelButtonColor: ‘#9FC33A’, confirmButtonText:’Yes’,… Continue reading Option to delete customers account from the Myaccount

Create a custom field on the checkout shipping method page

On the checkout_index_index.xml <item name=”shipping-step” xsi:type=”array”> <item name=”children” xsi:type=”array”> <item name=”shippingAddress” xsi:type=”array”> <item name=”children” xsi:type=”array”> <item name=”shippingAdditional” xsi:type=”array”> <item name=”component” xsi:type=”string”>uiComponent</item> <item name=”displayArea” xsi:type=”string”>shippingAdditional</item> <item name=”children” xsi:type=”array”> <item name=”additional_block” xsi:type=”array”> <item name=”component” xsi:type=”string”>JJ_Checkoutupdate/js/view/custom-field</item> </item> </item> </item> </item> </item> </item> </item> web->template folder (custom-field.html) <div class=”form-shipping-addres”> <div class=”field memo” style=”padding-bottom: 20px; font-size:16px;”> <label class=”label” for=”memo”> <span>Memo</span>… Continue reading Create a custom field on the checkout shipping method page

verifying the component items of a Bundle item is available at any location

$qty = 0; $sortedSource = []; foreach ($items as $item) { $newsku = $item->getSku(); $sourceItemList = $cduObj->getSourceItemBySku($newsku); $sortedSource[$newsku] = 0; foreach ($sourceItemList as $source) { if ($source->getStatus() == 1) { $sortedSource[$newsku] = $sortedSource[$newsku] + $source->getQuantity(); } } if ($sortedSource[$newsku] != 0) { $sortedSource[$newsku] = $sortedSource[$newsku] / $item->getQty(); } } $filteredItems = array_filter($sortedSource, function($value) { return… Continue reading verifying the component items of a Bundle item is available at any location