C\AL Type conversion trouble
InnerCode
Member Posts: 8
Hi,
I'm getting stuck on the following problem.
I've the table "Service Order Cost Plus Entry" as Data Source. Then in the "Service Order Cost Plus Entry - OnAfterGetRecord" section are the following C\AL Locals declared:
lvServiceLedgerEntry = type: record, table "Service-Ledger Entry" (11012819)
lvEntryNo = type: integer
So I want to set a filter on lvServiceLedgerEntry."Entry No." = "Entry No. Service Ledger" with the following code:
lvServiceLedgerEntry.SETFILTER("Entry No.", "Entry No. Service Ledger");
That gives a type conversion error Text := Integer
So I've to convert lvServiceLedgerEntry."Entry No." into a integer.
The case is that EVALUATE(lvEntryNo, lvServiceLedgerEntry."Entry No.") doesn't work because it sees the column as integer and not as text.
How can I apply the filter? Thanks in advance.
Regards,
InnerCode
I'm getting stuck on the following problem.
I've the table "Service Order Cost Plus Entry" as Data Source. Then in the "Service Order Cost Plus Entry - OnAfterGetRecord" section are the following C\AL Locals declared:
lvServiceLedgerEntry = type: record, table "Service-Ledger Entry" (11012819)
lvEntryNo = type: integer
So I want to set a filter on lvServiceLedgerEntry."Entry No." = "Entry No. Service Ledger" with the following code:
lvServiceLedgerEntry.SETFILTER("Entry No.", "Entry No. Service Ledger");
That gives a type conversion error Text := Integer
So I've to convert lvServiceLedgerEntry."Entry No." into a integer.
The case is that EVALUATE(lvEntryNo, lvServiceLedgerEntry."Entry No.") doesn't work because it sees the column as integer and not as text.
How can I apply the filter? Thanks in advance.
Regards,
InnerCode
0
Best Answer
-
so lvServiceLedgerEntry."Entry No." is a text field and "Entry No. Service Ledger" is a integer field?
Did you try
lvServiceLedgerEntry.SETFILTER("Entry No.", FORMAT("Entry No. Service Ledger"));5
Answers
-
so lvServiceLedgerEntry."Entry No." is a text field and "Entry No. Service Ledger" is a integer field?
Did you try
lvServiceLedgerEntry.SETFILTER("Entry No.", FORMAT("Entry No. Service Ledger"));5 -
Many thanks mohana_cse06!
I was staring for hours on this problem.0 -
Probably due to Friday0
-
When you set a simple filter you should use SETRANGE and not SETFILTER.
lvServiceLedgerEntry.SETRANGE("Entry No.", "Entry No. Service Ledger");
/Juha0
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
- 328 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
