Hello all,
Here is my issue: I have a table (Sales Contract) which contains contract information and a date field which I need to update. The updates need to come from TableB which contains nothing but the contract number and a date. The date field from Sales Contract needs to be updated with the date value from TableB when the no. field from Sales Contract equals the ContractNo field from TableB. I wrote a report and in the OnPreReport() I wrote the following code:
IF SalesContract.”No.” = TableB.ContractNo THEN
SalesContract.”Created Date” := TableB.DocumentDate;
SalesContract.MODIFY;
When I run the report I get an error message saying that “Sales contract No. ‘’ does not exist.”
I’m not sure where the problem is. Any help or pointing to resources that might help would be greatly appreciated. Thanks in advance for any assistance.
0
Answers
OnPreReport trigger is executed before a report is run. Typically, this trigger is used to get the filters of the report.
What are your dataitems in report and how they are linked?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Yes TableB is indented under the Sales Contract table.
Delete global record variables if declared
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
IF SalesContract.”No.” = TableB.ContractNo THEN begin //Changed
SalesContract.”Created Date” := TableB.DocumentDate;
SalesContract.MODIFY;
End;//Added
Try this code and check.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav