Using Form.Runmodal in a table

bhuber
Member Posts: 78
I needed to perform a lookup on the Filing Status field from a new table I recently created. The lookup should restrict the Filing Status codes to those available for the Payroll Control Code contained on the same record in the table. This is exactly the same process that is used in the Navision Employee Tax Info table for the Filing Status Lookup. I basically used Navision's code in my table in the lookup trigger for Filing Status as follows:
LoadTempFilingStatusTable;
TempFilingStatus.Code := "Filing Status Code";
IF FORM.RUNMODAL(10107,TempFilingStatus) = ACTION::LookupOK THEN
"Filing Status Code" := TempFilingStatus.Code;
The system complied this code, but when I execute it, I get the following Error:
The following C/AL functions can be used only to a limited degree during write transactions (because one or more tables will be locked).
Form.RunModal()is not allowed in write transactions.
Why am I getting this error? How is Navision able to use it in the Employee Tax Info Table? Any ideas?
LoadTempFilingStatusTable;
TempFilingStatus.Code := "Filing Status Code";
IF FORM.RUNMODAL(10107,TempFilingStatus) = ACTION::LookupOK THEN
"Filing Status Code" := TempFilingStatus.Code;
The system complied this code, but when I execute it, I get the following Error:
The following C/AL functions can be used only to a limited degree during write transactions (because one or more tables will be locked).
Form.RunModal()is not allowed in write transactions.
Why am I getting this error? How is Navision able to use it in the Employee Tax Info Table? Any ideas?
0
Comments
-
A write transaction is started - this means, that at least one table is locked until the transaction is through. Why it's not allowed to open a window during that time? Imagine what would happen if you would open your window and then leave your office. The table would stay locked until you came back. That's why this is not allowed at that time.0
-
I forgot ...
... if the error occurs in your table, but not in the table where you got the code from, then in the original table there is no writing transaction started. So the process cannot be exactly the same. Do you perfom any INSERT, MODIFY, DELETE or RENAME before this code ?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