Proposal Summary
When the project is given in the forms, the fields (Category, Division & Class) must be mandatory. It’s only for the Inspace subsidiary.
Requirements
When creating/editing the purchase order, Vendor bill, and bill credit records in Netsuite. The project field in the item/expense sublist has value then the record is not allowed to save without value in Category, Division & Class field for the corresponding line.
This validation only works for transactions with a subsidiary named Inspace.
Our Solution
- We will create a client script for validating the field named project in the item/expense sublist.
- This script will be deployed for purchase orders, vendor bills, and bill credit records.
- This script will check the validation for the project field.
- When users create/update any of these records. The script will work.
- Then the script will check the subsidiary of the transaction if the transaction subsidiary is “Inspace”. The script will continue with the validation process. The script will check if the project field is empty or not?
- If the project field has value then the script will check if the Category, Division & Class fields have value or not.
- If anyone of these 3 fields is empty. The script will show an alert “Please enter the value for Category, Division & Class”and not allow for committing the line in the sublist.
- Also we have checked the same validation when saving the record. This will help us to detect validation for item lines created through adding multiple buttons.
- If any line has a project field and Category, Division & Class are empty, the same alert “Please enter the value for Category, Division & Class” will be shown in the UI and record not allowed to save.
Assumption
- There will be a chance for performance issues depending on the more items/expenses in the sublist.
- This validation only works for transactions, which will be created/edit transaction records through the Netsuite UI.
- This script will not work purchase order, vendor bill, and bill credit records created through the bulk creation page and other contexts using suite script record creation.
- The validation for the expense sublist only considers the bill record.