I built a report using the Salesperson, Sales Line and Sales Invoice Line tables. When running the report I want the Salesperson Code and Date Filter (range) to be filled in on the Salesperson request form, in other words not blank. I added the following code to the OnPreDataItem of the Salesperson properties. Problem is I get the error when I do complete the fields on the request form. Do I need to do something to the other tables? Any help would be greatly appreciated.
SalespersonCode := Salesperson.Code;
FromDate := Salesperson.GETRANGEMIN("Date Filter");
ToDate := Salesperson.GETRANGEMAX("Date Filter");
IF (SalespersonCode = '') THEN
ERROR(TEXT003);
IF FromDate = ToDate THEN
ERROR(TEXT004);
0
Comments
if u use
then it mean, that the variable SalespersonCode gets the value of the field Code from a rec in the table salesperson.
But u need the filter from the request form. so use:
Regards