Invalid SourceTablePlacement

Christian_Buehl
Member Posts: 145
My forms for the sales quote, sales invoice e.g use (as defined in the standard) the property
SourceTable: Sales Header
SourceTableView: WHERE(Document Type=FILTER(Invoice))
SourceTablePlacement: <Saved>
If I now use this form in company1 and create an invoice, the table view remains on the saved position of the last invoice (which is basically ok).
When I now switch to company2 and try to open the form it cancels with an error, that the record (which was used in company1) can't be found.
The problem occurs since I put some code in the OnOpenForm trigger to disable or enable some fields for the user to modify. The reason is not in the code by itself, because I don't get any break with the debugger.
Thanks
SourceTable: Sales Header
SourceTableView: WHERE(Document Type=FILTER(Invoice))
SourceTablePlacement: <Saved>
If I now use this form in company1 and create an invoice, the table view remains on the saved position of the last invoice (which is basically ok).
When I now switch to company2 and try to open the form it cancels with an error, that the record (which was used in company1) can't be found.
The problem occurs since I put some code in the OnOpenForm trigger to disable or enable some fields for the user to modify. The reason is not in the code by itself, because I don't get any break with the debugger.
Thanks
0
Comments
-
I assume enabling/disabling is not rec depended. Try putting your code on some 'later' trigger like OnAfterGetCurrRecord().
You can create a new function that encapsulates your code, then you can create a Boolean like bMyFunctionHasRun which tells you if your function was already run to prevent runing all the time. (Check at beginning for true, set at the end to true).®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
Thanks a lot, that worked.
I put the part of the code which enables/disables fields into OnActivateForm.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