Monday, February 25, 2019

CSS > On lead record, check if a sales rep has been set as primary

When user has the 'Team Selling' feature enabled and navigates to Lead record > Sales Team, there is a 'Primary' field to determine which employee the user would like as the primary rep for this lead. The user can run a client script to display a message and prevent a user from saving the lead record if a rep is not set as the primary sales rep.

Deployed as a client side save record function.

This following script does the following:

  1. Gets the number of reps using nlapiGetLineItemCount
  2. Goes through each line item and determines if a rep has been set as 'Primary'
  3. If a a rep was not specified as 'Primary', it will display an alert message notifying the user
    to specify a rep as 'Primary'

No comments:

Post a Comment