Problem with item selection in a report

poppins
Member Posts: 647
Hi everyone,
I am trying to modify the rounding precision for certain items...so I built a report based on Item table with the following code:
OnPreDataItem() trigger
The result I get is that all the items have been modified, not just those I set with SETFILTER...
I feel that the code is mis-placed...
Can you help???
I am trying to modify the rounding precision for certain items...so I built a report based on Item table with the following code:
OnPreDataItem() trigger
recItem.SETFILTER("No.",'%1 | %2,','1000','1001');OnAfterGetRecord() trigger
CurrReport.BREAK;OnPreReport() trigger
IF recItem.FINDSET THEN BEGIN REPEAT recItem."Rounding Precision":=0.01; recItem.MODIFY; UNTIL recItem.NEXT=0; END;
The result I get is that all the items have been modified, not just those I set with SETFILTER...
I feel that the code is mis-placed...
Can you help???
0
Answers
-
On Prereport trigger will be excecuted before onpredataitem trigger..so it loop through all items and modified..0
-
mohana_cse06 wrote:On Prereport trigger will be excecuted before onpredataitem trigger..so it loop through all items and modified..0
-
What are the dataitems you have?
What is the m ain purpose of report?0 -
mohana_cse06 wrote:What are the dataitems you have?
What is the m ain purpose of report?
I have only one dataItem based on the Item table...
The purpose of the report is to change the rounding precision for certain items...0 -
Did you also take recItem as variable?
then remove it and set
SETFILTER("No.",'%1 | %2,','1000','1001');
filter in OnpreDataitem
and
"Rounding Precision":=0.01;
MODIFY;
in OnAftergetrecord trigger..0 -
mohana_cse06 wrote:Did you also take recItem as variable?
then remove it and set
SETFILTER("No.",'%1 | %2,','1000','1001');
filter in OnpreDataitem
and
"Rounding Precision":=0.01;
MODIFY;
in OnAftergetrecord trigger..
OK...0 -
I tried what you said and it only modified the first item mentionned in the filter...0
-
You wrote below code in OnAftergetrecord trigger only, right?
"Rounding Precision":=0.01;
MODIFY;0 -
mohana_cse06 wrote:You wrote below code in OnAftergetrecord trigger only, right?
"Rounding Precision":=0.01;
MODIFY;0 -
Remove , after %2 in below statement
SETFILTER("No.",'%1 | %2,','1000','1001');
should be
SETFILTER("No.",'%1 | %2','1000','1001');0 -
mohana_cse06 wrote:Remove , after %2 in below statement
SETFILTER("No.",'%1 | %2,','1000','1001');
should be
SETFILTER("No.",'%1 | %2','1000','1001');
:oops:
Thank you for your patience !!!0 -
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions