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.
Tag: client script
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.
Client script for setting the value of custom fields to empty whose display type is false
Requirement Based on the custom form selected from a select box, there are some fields whose display type can be false or true. On the save of that record, find all the custom fields whose display type is false and set those custom fields to empty. Solution
Auto journal creation & application in Payment
Scenario: Create a journal for applying in the credit section of the payment. Ultimate need is to capture the credit info from the custom record, need to create a journal or custom transaction of journal type then apply the same in the payment record.We have seen a limitation of once payment is saved the credit… Continue reading Auto journal creation & application in Payment
Comparing Two dates
Scenario: We have a start date and a Due date and need to a validation where Due date date should be a date after the Start date. Solution: Usually we can use the JavaScript Date() function. But you can’t compare two dates using that. Better approach to make comparison between dates is to use getTime() function. This… Continue reading Comparing Two dates