HELP!! Filter on RecordID with 'reserved chars' in key

itinkiam
Member Posts: 37
My customer has input customers using reserved characters. EX: Customer no. D&B.
I am using a form to show the Record Links and it works for all Customers except for D&B. When I add a record link with the paperclip, The Record Link is Customer: D&B.
When I try accessing the Customer Link through my form, the filter being set is Customer: D&Bank Account. I've tried all sorts of ways to try to force the filter. I've had no luck.
Please tell me there is a solution short of the customer having to rename his customers?
I am using a form to show the Record Links and it works for all Customers except for D&B. When I add a record link with the paperclip, The Record Link is Customer: D&B.
When I try accessing the Customer Link through my form, the filter being set is Customer: D&Bank Account. I've tried all sorts of ways to try to force the filter. I've had no luck.
Please tell me there is a solution short of the customer having to rename his customers?
0
Comments
-
Can you post the way how you are setting the filter?0
-
The characters & % ? should not be used in keys. The style sheet/export tool won't work with this also.0
-
//===Here's my code snippet====//
MyRecordRef.GETTABLE(Rec);
RecLink.SETFILTER("Record ID",FORMAT(MyRecordRef.RECORDID));
RecLink.SETRANGE(Company,COMPANYNAME);
MyRecordRef.CLOSE;
FORM.RUN(FORM::DocLinks,RecLink);
///=========
IF you do a message(FORMAT(MyRecordRef.RECORDID)) on the Customer table with Customer no. D&B, it returns "Customer: D&B" as expected.
But when you apply the filter, it sets the filter to "Customer: D&Bank Account".
I know customer's shouldn't use reserved fields in key fields. But, try telling a customer that after the system has allowed them to do it over 50 companies, and 8 years of data collection. Renaming each customer takes over 5 hours. Not a possiblilty in this case.0 -
Try this,
rec.setfilter(field, '%1', 'D&B');
But if you want set the same filter on form, filter as 'D&B'Uday0 -
Exactly as Pruday wrote... in your way, the value is taken as filter - it means that & is as AND. In a Pruday way, the value is taken as one value, and the & is part of the value...0
-
Thanks Guys. I tried your suggestion and got an error when trying to compile.
Type conversion is not possible because 1 of the operators contains an invalid type.
RecordID := Text
//===
I didn't quite understand what Pruday meant by:But if you want set the same filter on form, filter as 'D&B'
//===
If not, any other ideas? I am desperate. ](*,)0 -
The record ID field is not good for filtering. When I am using Record ID, I have another field of type Text (or code) where I am storing the Record ID in text format (using FORMAT to convert it to text). If you do that, you can filter on Record ID.
Quote from on-line help:RECORDID
This data type contains the table number and the primary key of a table. You can store a RecordID in the database but you cannot set filters on a RecordID.0 -
Though there are ways (see above) to set the filter, you really want to advise your client to use a different name in the primary key field.
They are going to find unexpected results throughout the standard product otherwise.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