1. Setup > Customization > Scripts > New > Client
2. Upload the script below and reference the function name (testOne) on the Field Changed Function
function testOne(type)
{
if(type=='addressbook'){
var poppin = nlapiGetCurrentLineItemIndex('addressbook');
alert(poppin);
}
}
3. Save and Deploy the Client Script
4. On the Script Deployment, set the following below.
-- Applies To: Customer
-- Audience > Roles = All Roles = T
5. Save
Note: Clicking the "Add / Edit" button will always return the current number of items plus 1. As the button label states, it has two functions wherein updated / changed line items are saved and a new line item is selected at the end when clicked. So if you edit line item 2 on a list of 5 line items and hit the "Add / Edit" button, the changes will be saved to line item 2 but the alert will return 6.
No comments:
Post a Comment