Batch report changes data in other companies

mplatvoet
Member Posts: 34
I have a weird thing:
I create a batch report on a table (table is local, so each company has its own table and also in SQL Server the companyname+$ prefix).
I change a decimal field in the table with te report with the following code in the OnAfterGetRecord trigger:
<field> := ROUND(<CurrentFieldValue>,0.01);
MODIFY;
In other words I rounded the fieldvalue. I didn't use the table prefix.
What happened was that this also was executed in the other company in the database! I never seen this before and wonder what could have caused this.
I used SQL Server 2005 and NAV 4.0 SP3 UPDATE4.
Anyone seen this before? And knows what could cause this?
I create a batch report on a table (table is local, so each company has its own table and also in SQL Server the companyname+$ prefix).
I change a decimal field in the table with te report with the following code in the OnAfterGetRecord trigger:
<field> := ROUND(<CurrentFieldValue>,0.01);
MODIFY;
In other words I rounded the fieldvalue. I didn't use the table prefix.
What happened was that this also was executed in the other company in the database! I never seen this before and wonder what could have caused this.
I used SQL Server 2005 and NAV 4.0 SP3 UPDATE4.
Anyone seen this before? And knows what could cause this?
0
Comments
-
Are you sure that it was executed in other companies by running it in one of them? How did you check that? Is working someone else on the database too?0
-
I ran the report using CTRL+R from the designer, I didnt save it.
So it was not present in the object designer.
Before I ran it I saw that all fields had 4 or 5 digits in both companies, afterwards only 2, in both companies.
It really looks like it had run in both companies, but I cannot explan why.0 -
How did you look at the table? If you look directly to the table in NAV, you will see as many decimals as configured on the field. If you look through SQL, you will see all decimals. If you look through form, you will see as many decimal as set on the form or field. It means you can have different result with different methods of viewing the data...0
-
Before and afterwards I checked on the form. Before I ran the report it showed 4/5 decimals and afterwards 2...0
-
It is weird, because by default all decimal fields are in NAV set to 2 decimal places. How was the table filled in? Through NAV or SQL?0
-
Not when you run the adjust item/cost prices and then recalculate the unit price with factor 1.05.
The field I am talking about is the Item Unit Price.
For your reassurance: I Validated the field after I rounded it.0 -
Ok, I thought that it were some new field you created. Precision of Unit cost is set through G/L Setup field "Unit-Amount Rounding Precision". And the precision can be related to used Currency (each currency can have different precision)...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