catch from temporary table,cannot?

julkifli33
Member Posts: 1,092
I'm using Table 246 (Requisition Line) with TempRL as temporary variable and RL as not temporary variable
but why I cannot catch if i set TempRL as Temporary table?
if i set as not temporary table, i can catch.....
what do i miss?
My code
but why I cannot catch if i set TempRL as Temporary table?
if i set as not temporary table, i can catch.....
what do i miss?
My code
TempRL.SETRANGE(TempRL."No.",RL."No."); TempRL.SETRANGE(TempRL."Variant Code",RL."Variant Code"); IF TempRL.FIND('-') THEN message('TEST');
0
Answers
-
Hi,
I think first you need to check Temporary table contain any data or not by using count.Then start to apply any filter.Regards,
Hemant
They can conquer who believe they can.0 -
hemantOne wrote:Hi,
I think first you need to check Temporary table contain any data or not by using count.Then start to apply any filter.
if i set temporary = no --> it can be caught
but if i set temporary = yes --> it cannot be caught0 -
TempRL --> Requisition Line (Temporary Yes)
Test --> Requisition Line (Temporary No)MESSAGE('Test%1 RL%2',Test.COUNT,TempRL.COUNT);
Test 10 RL 0
Why is it like this???0 -
hi,
First Insert the records in TempRL before applying any filter.
I don't know what u trying but may be you need --
TempRL := RL;
TempRL.Insert;Regards,
Hemant
They can conquer who believe they can.0 -
My full code is like this
if the record already in it, it should be modify
but if not, then it's insert
For your information , i already done using this code for purchase and sale
after i copy paste, for requisition is cannotTempRL.RESET; TempRL.Quantity := 0; TempRL.SETRANGE(TempRL."Worksheet Template Name",RL."Worksheet Template Name"); TempRL.SETRANGE(TempRL."Journal Batch Name",RL."Journal Batch Name"); TempRL.SETRANGE(TempRL."Vendor No.",DocNo); TempRL.SETRANGE(TempRL.Type,2); TempRL.SETRANGE(TempRL."No.",RL."No."); TempRL.SETRANGE(TempRL."Variant Code",RL."Variant Code"); IF TempRL.FIND('-') THEN BEGIN REPEAT TempRL.GET(TempRL."Worksheet Template Name",TempRL."Journal Batch Name",TempRL."Line No."); TempRL.Quantity := TempRL.Quantity + RL.Quantity; TempRL.MODIFY; UNTIL TempRL.NEXT =0; END ELSE BEGIN TempRL."Worksheet Template Name" := RL."Worksheet Template Name"; TempRL."Journal Batch Name" := RL."Journal Batch Name"; TempRL."Line No." := RL."Line No."; TempRL.Type := 2; TempRL."No." := RL."No."; TempRL."Variant Code" := RL."Variant Code"; TempRL.Quantity := RL.Quantity; TempRL.INSERT; END;
0 -
Hi,
Your code seems correct , debugger may be help you to find if anything wrong....Regards,
Hemant
They can conquer who believe they can.0 -
hemantOne wrote:Hi,
Your code seems correct , debugger may be help you to find if anything wrong....
i really confused about this
how to use debugger??0 -
i already solved it
if forgot to insert the vendor no.
but i setrange it
now....TempRL."No." := RL."No."; TempRL."Variant Code" := RL."Variant Code"; [b] TempRL."Vendor No." := RL."Vendor No.";[/b] TempRL.Quantity := RL.Quantity;
now it's ok
thanks0
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