Using SUitescript 2.0 function search.lookupFields we can get any fields in sales order, from there we can get customer id for the correspomding customer record. Code snippet:
Tag: client script
Item Cost Auto Update in Open POs
REQUIREMENT The requirement is that need to update the none of PO status closed, canceled and billed PO’s with the new item rate when it is being updated in the item record. SOLUTION Client script for to check if the item rate is changed in Item Record A custom record is created to store the… Continue reading Item Cost Auto Update in Open POs
Accessing current record mode in client script in fieldChanged entry point
Declare a global variable.In paginit entrypoint ,get the script context mode and store the value in the global variableIn fieldChanged entry point this global variable can be referenced for getting the scriptContext type.
Double Entry of the Same Customer PO
Requirement We need the prevention of double-entry of the same Customer PO. We can show an alert message while trying to save the record. This alert also prevents the user from saving the sales order record. To check the double entry, we will check if there are any already existing sales order that has the… Continue reading Double Entry of the Same Customer PO
Script for Updating shipping cost in ItemFulfilment Record.
This is a Client script for updating shipping costs in the IF record based on a custom field ( Shipping methods). Based on different Ship methods the shipping cost will be set. Except for Ship methods: ( ‘blank’, Truck (LTL), other, Customer Pickup, FedExGD Collect, Broker, TBD) The shipping cost will be zero. in all… Continue reading Script for Updating shipping cost in ItemFulfilment Record.
Un expected Error:
Some times an Un expected console error may occur in client script when we try to use console.log() method in the pageInit . In order to remove this types of errors avoid using the console.log(). Instead of this we can use log.debug() in pageInit
Interact with Backend Suitelet
In Netsuite Customization Client script executes in the logged-in user’s role. This can create errors while trying to access records for which the logged-in user doesn’t have the required permission. The solution is to call a backend suitelet from the client script. We suggest If you need to use that value in the client script for setting… Continue reading Interact with Backend Suitelet
Add Address Limit Checkbox to Restrict Adding/Editing/Deleting of any Address to the Address book of Customer Record in Netsuite.
Create an entity field(checkbox) and add the condition if the checkbox enabled the customer not allowed to add or delete the address. For achieving the solution we can use the Client script 2.0 : first, need to create a custom entity field in NetSuite with type as a checkbox. Add the enity field to customer… Continue reading Add Address Limit Checkbox to Restrict Adding/Editing/Deleting of any Address to the Address book of Customer Record in Netsuite.