Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Development platform = Dynamics AX 2012, CU3

How do I solve this problem with my display method:

C#
display invoiceDate InvoiceDate()
{
     CustInvoiceJour custInvoiceJour;
     CustTable       custTable_1;
            
     CustTable custTable_1 = CustTable::find('1').InvoiceAccount; //pass the customer account number
     

 select maxDate(INVOICEDATE) from CustInvoiceJour
              where custInvoiceJour.InvoiceAccount == custTable_1.InvoiceAccount;  
         
    
     return custInvoiceJour.invoiceDate;
}

When compiled it give an error message:
The name custTable_1 has already been assigned to another variable.

I tried renaming the CustTable table name to custTable and received a "Datasource arlready exists" error message when compiled.

I am trying to return the latest Sales Invoice Date when a customer record is selected in the Customer Profile form.
Posted
Updated 4-Apr-13 7:09am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900