These are the tables I'm working on:
| DriverShipTable |
| -SeqNo int |
| DriverShipTableDet |
|
-SeqNo int
-InvoiceNo
|
| CustInvoiceJour |
|
-InvoiceId str
-CustAccount str
|
Table relationships:
DriverShipTable.SeqNo = DriverShipTableDet.SeqNo
DriverShipTableDet.InvoiceNo = CustInvoiceJour.InvoiceId
My goal is to create a view with a column that counts the total of CustInvoiceJour.CustAccount Group By DriverShipTable.SeqNo.
So, I'm writing an X++ method inside the CustInvoiceJour Table as following:
public display int customerCount()
{
DriverShipTableDet driverShipTableDet;
DriverShipTable driverShipTable;
select *
from driverShipTableDet
where driverShipTableDet.InvoiceNo == this.InvoiceId
join driverShipTable
where driverShipTable.SeqNo == driverShipTableDet.SeqNo;
custCount =
(select count (this.InvoiceAccount) //........SYNTAX ERROR HERE........
group by driverShipTable.SeqNo;)
return custCount;
}
Will you please help me correct my syntax? I'm totally new with X++ so I'm very confused with how to properly using values or calling existing table methods. Any kind of guidance will be appreciated.
Thank you very much.