Error with developing a report in AL code in Dynamics 365 BC

AitorEG
Member Posts: 342
Hi eveyone,
I don't know if this is the best place to ask this question. I'm developing a new report, and the issue is this.
This is how the datset is defined:
As you an see, I have 3 calls to the "CreateSKU" procedure, and I have this error:

I've defined the procedure inside the requestPage like this:

But it seems I should define it in other place. Any hint?
Thank you very much
I don't know if this is the best place to ask this question. I'm developing a new report, and the issue is this.
This is how the datset is defined:
dataset { dataitem(Item;Item) { DataItemTableView=SORTING("No."); RequestFilterFields = "No.","Inventory Posting Group","Location Filter","Variant Filter" ; trigger OnPreDataItem() begin Location.SETRANGE("Use As In-Transit",FALSE); DialogWindow.OPEN(Text000 +Text001 +Text002); //BETEASTD SaveFilters := TRUE; SaveFilters := FALSE; //BETEASTD end; trigger OnAfterGetRecord() var ItemVariant: Record 5401; begin IF SaveFilters THEN BEGIN LocationFilter := GETFILTER("Location Filter"); VariantFilter := GETFILTER("Variant Filter"); SaveFilters := FALSE; END; SETFILTER("Location Filter",LocationFilter); SETFILTER("Variant Filter",VariantFilter); Location.SETFILTER(Code,GETFILTER("Location Filter")); IF ReplacePreviousSKUs THEN BEGIN StockkeepingUnit.RESET; StockkeepingUnit.SETRANGE("Item No.","No."); IF GETFILTER("Variant Filter") <> '' THEN StockkeepingUnit.SETFILTER("Variant Code",GETFILTER("Variant Filter")); IF GETFILTER("Location Filter") <> '' THEN StockkeepingUnit.SETFILTER("Location Code",GETFILTER("Location Filter")); StockkeepingUnit.DELETEALL; END; DialogWindow.UPDATE(1,"No."); ItemVariant.SETRANGE("Item No.","No."); ItemVariant.SETFILTER(Code,GETFILTER("Variant Filter")); CASE TRUE OF (SKUCreationMethod = SKUCreationMethod::Location) OR ((SKUCreationMethod = SKUCreationMethod::"Location & Variant") AND (NOT ItemVariant.FIND('-'))): BEGIN IF Location.FIND('-') THEN REPEAT DialogWindow.UPDATE(2,Location.Code); SETRANGE("Location Filter",Location.Code); [b]CreateSKU(Item,Location.Code,'');[/b] UNTIL Location.NEXT = 0; END; (SKUCreationMethod = SKUCreationMethod::Variant) OR ((SKUCreationMethod = SKUCreationMethod::"Location & Variant") AND (NOT Location.FIND('-'))): BEGIN IF ItemVariant.FIND('-') THEN REPEAT DialogWindow.UPDATE(3,ItemVariant.Code); SETRANGE("Variant Filter",ItemVariant.Code); [b]CreateSKU(Item,'',ItemVariant.Code);[/b] UNTIL ItemVariant.NEXT = 0; END; (SKUCreationMethod = SKUCreationMethod::"Location & Variant"): BEGIN IF Location.FIND('-') THEN REPEAT DialogWindow.UPDATE(2,Location.Code); SETRANGE("Location Filter",Location.Code); IF ItemVariant.FIND('-') THEN REPEAT DialogWindow.UPDATE(3,ItemVariant.Code); SETRANGE("Variant Filter",ItemVariant.Code); [b] CreateSKU(Item,Location.Code,ItemVariant.Code);[/b] UNTIL ItemVariant.NEXT = 0; UNTIL Location.NEXT = 0; END; END; end; } }
As you an see, I have 3 calls to the "CreateSKU" procedure, and I have this error:

I've defined the procedure inside the requestPage like this:

But it seems I should define it in other place. Any hint?
Thank you very much
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