Focus on empty record in tablebox triggers OnInsertRecord()

kenyo
Member Posts: 40
Hi, my problem is , i open the form the form already filtered. If no record is found, an empty one is automatically created to set the focus on it. As soon as i try to click somewhere else it tries to insert that empty record into the table which results in an error ( thankfully ). If i set the property focusable to false this problem doesn't occur. But then the user can't select any records at all which they should. Editable is already false and i wonder , since the primary key is empty anyway why the OnInsert trigger is called at all 
I've tried to exit the oninsert trigger but then the action gets canceled entirely so you can't click or do anything else.
Funnily enough if i touch the scroll bar, the focus is disabled without triggering anything and i can operate the form as intended.
Is there maybe an option that lets me change control properties on the fly ? or do you have any other solution ? Cheers.
P.S: side question: If no filter is set on the table it shows all records. Can i instead show no record at all? because i have a subform in this tab which shows the sales invoice lines according to the selected sales invoice header. but it shows the whole table if nothing is selected.


I've tried to exit the oninsert trigger but then the action gets canceled entirely so you can't click or do anything else.
Funnily enough if i touch the scroll bar, the focus is disabled without triggering anything and i can operate the form as intended.
Is there maybe an option that lets me change control properties on the fly ? or do you have any other solution ? Cheers.
P.S: side question: If no filter is set on the table it shows all records. Can i instead show no record at all? because i have a subform in this tab which shows the sales invoice lines according to the selected sales invoice header. but it shows the whole table if nothing is selected.

0
Best Answer
-
In the properties of the form there is InsertAllowed. Did you try setting this to false?5
Answers
-
In the properties of the form there is InsertAllowed. Did you try setting this to false?5
-
You're a lifesaver, thanks!0
-
You're welcome!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