Data type conversion problem

Soloper
Member Posts: 102
Hi all;
I have a form and it contains only a textbox and a command button. I ask user to enter a date into the textbx then press the button.
After that I want to filter G/L Entry table by this date with the following line;
SETRANGE("Posting Date", CurrForm.txtPostingDate);
I wrote it down into command OnPush trigger of the button.
When I try to compile I get the following error :
Type conversion is not possible because 1 of the operators contains an invalid type
Date:=Control
I see the meaning of the error. But how can I compare or match a table field with the value of a form control?
Thanks so much.
I have a form and it contains only a textbox and a command button. I ask user to enter a date into the textbx then press the button.
After that I want to filter G/L Entry table by this date with the following line;
SETRANGE("Posting Date", CurrForm.txtPostingDate);
I wrote it down into command OnPush trigger of the button.
When I try to compile I get the following error :
Type conversion is not possible because 1 of the operators contains an invalid type
Date:=Control
I see the meaning of the error. But how can I compare or match a table field with the value of a form control?
Thanks so much.
0
Answers
-
You declare a global variable of type Date. Then you bind the textbox to the variable using Source Expression from the properties of the control. Finally:
glEntry.SETRANGE("Posting Date",MyGlobalTextVariable);0 -
Soloper wrote:SETRANGE("Posting Date", CurrForm.txtPostingDate);
I see the meaning of the error. But how can I compare or match a table field with the value of a form control?
You can use a data type 'Date' but that won't allow you to enter a datefilter. I would probably use a text type variable if I needed to be able to enter filters instead of single date values.0 -
The situation which explain Den, I used a text type variable and It works fine.
Thank you kapamarou and Den for the detailed replies.0 -
Soloper wrote:The situation which explain Den, I used a text type variable and It works fine.
Thank you kapamarou and Den for the detailed replies.
Rather use the Date type variable instead text variable... ;-)0 -
kine wrote:Rather use the Date type variable instead text variable... ;-)0
-
Yes, but it was not specified, Soloper is talking about date. In case of filter, text is ok, but I will use SETFILTER instead SETRANGE... 8)0
-
Right if they need a single date only, then I would also use a date type variable, and SETRANGE.0
-
I have a type conversion problem. i got a report sent from my head office.... it is a label printing report... when i imported and tried to compile, am getting type conversion error.
Microsoft Business Solutions-Navision
Type conversion is not possible because 1 of the operators contains an invalid type.
Text := VOID
OK
In that there is a coding line which is given below
Addr[1][1] := PrintBarCode.ParseRequest(ICR."Cross-Reference No.");
when I try to compile it throws the error and the cursor blink at this code only.
ADDR[1][1]is defined as text[250].
Printbarcode ====> NAv Comm (Codeuint)
there the cross reference no. is passed and get converted into barcode number....
can any body tell what is need to be done.....0 -
You should post this as a new topic. The original one is closed...
The Addr[1][1] looks suspicious.
How is it declared? Have you tried Addr[1,1]?0 -
yes... i had tried with that also......... but same tyoe conversion error...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