SETGANGE doesn't allow more than 3 characters

knaabis
Member Posts: 37
I need to get in my report from CrossReference Table some info with SETRANGE like this:
CLEAR(CrossRef1);
CrossRef1.SETRANGE("Description",CrossRef1."Description"::Box1);
CrossRef1.SETRANGE("Item No.","Item"."No.");
IF CrossRef1.FIND('-') THEN;
I get error message "The text 'BOX1' is too long. Text can have maximum lenght 3 characters."
CLEAR(CrossRef1);
CrossRef1.SETRANGE("Description",CrossRef1."Description"::Box1);
CrossRef1.SETRANGE("Item No.","Item"."No.");
IF CrossRef1.FIND('-') THEN;
I get error message "The text 'BOX1' is too long. Text can have maximum lenght 3 characters."
0
Comments
-
What is the Data Type of field CrossRef1.Description? If it is Text, you have to use something like:
CrossRef1.SETRANGE(Description,'Box1');No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
If you mean like this, then also doesn't work...
CLEAR(CrossRef1);
CrossRef1.SETRANGE(Description,'Box1');
CrossRef1.SETRANGE("Item No.","Item"."No.");
IF CrossRef1.FIND('-') THEN;0 -
Did you change any field ids in the table? It looks like that the field in the SetRange should not be description, because description is a text field, why would you setrange on it with an option. Probably what has happened is there was a field with type Option which has got changed and the description field has somehow got the id of the option field.
Chn0 -
what is the data type and length of the Description field ?Microsoft Certified IT Professional for Microsoft Dynamics NAV
Just a happy frood who knows where his towel is0 -
i think this is text field, but I'm not sure, because i haven't access in Table design...
This is Item Cross Reference Table - 57170 -
Is it possible for you to detect whether there was a change in the Field Ids in this table?
Chn0 -
knaabis wrote:I get error message "The text 'BOX1' is too long. Text can have maximum lenght 3 characters."
The message says CrossRef1.Description is a text field and length is 3 character. But when I read your code description appears as a option field. There is an inconsistency between the error message and the code. Have you been able to compile this object and receive this message after that?Ufuk Asci
Pargesoft0 -
knaabis wrote:If you mean like this, then also doesn't work...
CLEAR(CrossRef1);
CrossRef1.SETRANGE(Description,'Box1');
CrossRef1.SETRANGE("Item No.","Item"."No.");
IF CrossRef1.FIND('-') THEN;
Maybe "Box1" is written differently in the CrossRef table.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Luc Van Dyck wrote:knaabis wrote:If you mean like this, then also doesn't work...
CLEAR(CrossRef1);
CrossRef1.SETRANGE(Description,'Box1');
CrossRef1.SETRANGE("Item No.","Item"."No.");
IF CrossRef1.FIND('-') THEN;
Maybe "Box1" is written differently in the CrossRef table.
Box1 and BOX1
Thanks for help!0 -
did the error happen when you run it or when you save it ?Microsoft Certified IT Professional for Microsoft Dynamics NAV
Just a happy frood who knows where his towel is0 -
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