Using Form.Runmodal in a table

bhuberbhuber Member Posts: 78
edited 2001-02-06 in Navision Financials
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?

Comments

  • rmotzerrmotzer Member Posts: 11
    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.
  • rmotzerrmotzer Member Posts: 11
    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 ?
Sign In or Register to comment.