I'm putting some code into some pages to ensure fields have values. Below is what I've used on an opportunity page, the same under both OnClosePage and OnNextRecord.
It does the tests I want, but when I put it under OnNextRecord, it means the 'Next' or 'Previous' buttons won't work? When I click them it does the tests, but if they are all ok it doesn't go to the next record.
TESTFIELD("Customer Class Code"); TESTFIELD("End User Class Code"); TESTFIELD("Company Potential Rating"); TESTFIELD(Score); TESTFIELD("Campaign No."); IF("Literature Only" = FALSE) THEN TESTFIELD("Hire Sale Class Code"); TESTFIELD("Install Class Code"); TESTFIELD("Surveyor / Quoter");
Please help with what I need to change to make the next button work?
Thank you!
*This post is locked for comments
I have the same question (0)hi,
add
exit(next(Steps));
at the end of your code in the onnextrecord trigger.