[RESOLVED] TableData 0 does not exist

ccbryan63ccbryan63 Member Posts: 115
Hi, wie gehts, ciao, ca va, que pasa, ni hao ma.

I am in the process of converting a 4.0 service pack 3 DB to 5.0. I have been replicating modifications to a clean 5.0 database and I'm encountering this error when trying to compile Form 42 Sales Order in 5.0.

My 5.0 database is in native Navision (non-SQL). I am using our developer license, and there are no database logins set up.

The error message is "TableData 0 does not exist" and it shows the error to be in the following custom function, at the CALCFIELDS line:

DetermineCCStatus()
//Add credit card messaging
CALCFIELDS("Invoice Discount Amount");
IF ("Amount Submitted" <> 0) OR
("Amount Approved" <> 0) OR
("Amount Authorized" <> 0) THEN
BEGIN
CurrForm.CCMsg1.VISIBLE := TRUE;
CurrForm.CCMsg3.VISIBLE := TRUE;
//CurrForm.CCMsg5.VISIBLE := TRUE;
CurrForm.CCMsg7.VISIBLE := TRUE;
//check Amount since the Amount Including VAT does not calc until Release
....


The DetermineCCStatus() function is called from

Form - OnAfterGetRecord()
SETRANGE("Document Type");

//include message if credit card info exists
DetermineCCStatus;


Invoice Discount Amount is a custom field in the Sales Header Table. It is a flowfield that sums "Sales Line"."Inv. Discount Amount." I have verified that these fields are present in their respective tables and that those tables compile correctly. I have verified that Sales Header is the base table of the Sales Order Form.

What is this error trying to tell me?

Thanks in advance for your attention.

Chandler

Comments

  • easabanganeasabangan Member Posts: 114
    One reason why this error prompt is because there is a variable that has no table specified on it. Try using your debugger it will help you a lot.
    No future at CPI
  • kinekine Member Posts: 12,562
    Check the local variables of the function for the record type variable without sub-type as easabangan wrote.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ccbryan63ccbryan63 Member Posts: 115
    Bingo! Right first time. Thank you gentlemen.

    Chandler
Sign In or Register to comment.