Newbie Array Question.
JamieBrown
Member Posts: 107
Hi, Can anyone tell me why inv[1] through to inv[4] only displays the inventory for store 001 ?
I'm sure it's a stupid mistake on my part.
Many thanks
I'm sure it's a stupid mistake on my part.
store[1] := '001';
store[2] := '003';
store[3] := '008';
store[4] := '013';
FOR counter := 1 TO 4 DO BEGIN
"Stockkeeping Unit".SETFILTER("Location Code",store[counter]);
"Stockkeeping Unit".CALCFIELDS(Inventory);
inv[counter] := "stockkeeping unit".inventory;
END;
Many thanks
0
Answers
-
AFAIK stockkeeping unit is per item/location and/or variant.
Maybe:store[1] := '001'; store[2] := '003'; store[3] := '008'; store[4] := '013'; FOR counter := 1 TO 4 DO BEGIN IF "Stockkeeping Unit".GET(store[counter],vSomeItemNo,vSomeVariant) THEN BEGIN "Stockkeeping Unit".SETFILTER("Location Code",store[counter]); "Stockkeeping Unit".CALCFIELDS(Inventory); inv[counter] := "stockkeeping unit".inventory; END ELSE inv[counter] := 0; END;where the vSOmeItemNo, vSomeVaariant is the codes of the Item No. you are looking for and the variant code.
If no variants are used then you could use the empty string ''.0 -
JamieBrown wrote:"Stockkeeping Unit".SETFILTER("Location Code",store[counter]);
If you insert values at runtime ,use"Stockkeeping Unit".SETFILTER("Location Code",'%1',store[counter]);instead.Kai Kowalewski0 -
Perfect.
Many thanks to both of you.
Jamie0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 324 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

