Is it possible to have client script which does th...
# suitescript
p
Is it possible to have client script which does the following: 1. triggers when line item Price Level is manually changed on transaction 2. checks to see if the Customer has the Item in the Item Pricing sublist on the customer record, as the same Price Level in 1. a. If it does exist - do nothing b. If it does not exist on the Customer > Item Pricing sublist, then display error and revert the line Item price level to the Customer Price Level I thought I do trigger a script based on the customer being in a saved search result, but the Criteria of the search would need to look at Customer > Item Pricing, which it cannot seem to do
n
Sounds like on validate of the line you would ascertain the current sublist line price level and perform a search in your client script to check and return false along with an error.
a
You can accomplish this very efficiently with the query module because it would allows you to get the data you need with a single query, you can do: • In pageInit perform a query(with promise) to get the customer's items pricing and build an object with the items as keys and save that object to a global variable. • On fieldChange for the pricing level field, grab the item ID and using your global variable/data compare and decide what you need to do.
šŸ‘ 1
šŸ’Æ 1
šŸ‘šŸ» 1
a
For question 1 you can use fieldChanged() it will do the same as u need For question 2-a :- check for lineitem count getLineCount() for question 2-b :- check line item count is not 0 then throw error using ui module via client Script