Newbie - Question on Arrays
JamieBrown
Member Posts: 107
Hi,
I'll try and explain this as simply as possible.
I've created a sales report that uses the following array:
StartDates[1] := TODAY;
StartDates[2] := CALCDATE('-CW',TODAY);
StartDates[3] := CALCDATE('-CM',TODAY);
FOR Counter := 1 TO 3 DO BEGIN
Store.SETRANGE("Date Filter",StartDates[Counter],TODAY);
and call them via: NetBrandValue[1] etc (as you know)
(As you can see, I use it to display real-time Day, Week and Month sales)
This works fine for a single branch i.e.
Store.SETRANGE("No.",StoreSystemManagement.CurrentStore);
However, I would like to be able to display these figures on a report for all branches (we have 24)
Could I setup another array for these so I would have 2 dimensions on a single variable? Is that possible?
storenumber[a] := 001;
i.e. NetBrandValue[1][a]
I hope this makes sense.
Any suggestions or ideas would be greatly received!
thanks in advance.
I'll try and explain this as simply as possible.
I've created a sales report that uses the following array:
StartDates[1] := TODAY;
StartDates[2] := CALCDATE('-CW',TODAY);
StartDates[3] := CALCDATE('-CM',TODAY);
FOR Counter := 1 TO 3 DO BEGIN
Store.SETRANGE("Date Filter",StartDates[Counter],TODAY);
and call them via: NetBrandValue[1] etc (as you know)
(As you can see, I use it to display real-time Day, Week and Month sales)
This works fine for a single branch i.e.
Store.SETRANGE("No.",StoreSystemManagement.CurrentStore);
However, I would like to be able to display these figures on a report for all branches (we have 24)
Could I setup another array for these so I would have 2 dimensions on a single variable? Is that possible?
storenumber[a] := 001;
i.e. NetBrandValue[1][a]
I hope this makes sense.
Any suggestions or ideas would be greatly received!
thanks in advance.
0
Comments
-
in the array dimensions just put 3;20 for a 3 by 20 array
MyValue[1,1] := 123;
MyValue[2,1] := 124;
MyValue[3,1] := 125;
~to
MyValue[1,20] := 123;
MyValue[2,20] := 124;
MyValue[3,20] := 125;Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
David,
When I try to compile this I get the following Navision error message:
:= cannot be performed on arrays.
Choose a single array value using an expression such as:
MyArray[...]
any ideas?
thanks0 -
Have you changed the Dimensions-property of your array variable?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
yes, as soon as I change the variable dimensions I get that error.0
-
That is because somewhere in your code there is an assignment statement without the index number of your array. Once you change a variable to be an array, you have to specify the index every time you assign a value. Search your code for the variable name and you should find it.0
-
Thanks for your help, I'll run through the code.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 327 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

