[Closed] Filtering on part of primary key results in error

gazpacho
Member Posts: 48
Hi
I have a table with three field (w1, w2, w3, all of type code) and the primary key is 'w1,w2,w3'. Field w1 has a tablerelation with organisation, field w2 has a relation with table department.
I have a form that displays the records of this table in list form.
When I haven't set a filter on any of the field, scrolling past the last record results in the creation of a new record.
But when I have filtered on field w2 - let's say I only want to view department DEPT - and scroll past the last record it rises an error message saying Table Organisation not found. It tries to fill w1 and w3 with '' and w2 with 'DEPT'. But there is no Organisation with value '', so the error pops up.
Is there a way to work around this?
Regards
Josh
I have a table with three field (w1, w2, w3, all of type code) and the primary key is 'w1,w2,w3'. Field w1 has a tablerelation with organisation, field w2 has a relation with table department.
I have a form that displays the records of this table in list form.
When I haven't set a filter on any of the field, scrolling past the last record results in the creation of a new record.
But when I have filtered on field w2 - let's say I only want to view department DEPT - and scroll past the last record it rises an error message saying Table Organisation not found. It tries to fill w1 and w3 with '' and w2 with 'DEPT'. But there is no Organisation with value '', so the error pops up.
Is there a way to work around this?
Regards
Josh
0
Comments
-
You have focus on another field than the key and it tries to validate the values of the fields.
Maybe you could put the ValidateTableRelation property of the field (or fields) to FALSE, but in some cases you might get empty records if you move downwards with focus to another field other than one that is part of the key.
You could do that with the DelayedInsert propery of the form to yes to help you more...
Try a combination of those two properties or just the second and you will find the way...
Copy/paste of the help follows:ValidateTableRelation
Use this property to tell the system whether to validate a table relationship.
Applies to
Fields, text boxes
Settings
The ValidateTableRelation settings are:
To have the system...
Choose...
Validate the table relationship Yes (default)
Not validate the table relationship No
Comments
For fields, use this property to tell the system whether or not it should validate the user's entry based on the information already in the table set up through the TableRelation property.
If you want to let users enter any value without having the system validate the entry, choose No. For example, on the item card you can specify the vendor you normally purchase the item from. In the standard application, this property is set to No for this field, to let users select a vendor that may not already be in the Vendor table.
For text boxes, use this property to tell the system whether or not it should validate a table relationship.DelayedInsert
Use this property to have the system wait until the user leaves the record before it inserts the new record into the database. By default, the system inserts the new record when the user leaves the control that shows the primary key in the table.
Applies to
Forms
Settings
The DelayedInsert settings are:
To have the system insert the record when the user...
Choose...
Leaves the record Yes
Leaves the control that shows the primary key No (default)0 -
Thanks, I will give it a try!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