Saturday, November 17, 2018

Make Sales Team Mandatory When Team Selling is Enabled

User enabled Team Selling (Setup > Company > Enable Features > CRM Tab > Sales tab > Team Selling = T). In the Invoice Form, user wants to make the Sales Rep field mandatory. User customized the Invoice Form to make the field mandatory (Screen Fields tab > Main subtab). However, user can still save an Invoice even without specifying a Sales Rep in the Sales Team tab.

To resolve this, user would have to create a script to validate if there's a Sales Rep selected in the the Sales Team tab. To create the script perform the following steps:

 1. Open Notepad.

 2. Copy and paste the code below:


 3. Click File > Save As.

 4. In the File Name, enter: SalesRep.js then change Save as Type to All Files (*.*).

 5. Click Save.

 6. In NetSuite, navigate to Customization > Scripting > Scripts > New.

 7. Select Client.

 8. Provide Name (e.g. Validate Sales Rep).

 9. In the Scripts tab > Script File, select New.

 10. Locate the file created earlier then click Save.

 11. In the Save Record Function, enter saveRecord.

 12. In the Deployments tab, set Applies To to Invoice.

 13. Click Save.

To test, enter an Invoice with no Sales Rep set in the Sales Team tab. On save, user should get an alert.

Note: Issue#122361 has been filed as an Enhancement Request for the functionality to make the Sales Team Mandatory on Sales Forms when Sales Team is Enabled.

No comments:

Post a Comment