By using this website, you agree to our Terms of Use (click here)
hi, i am running a sql view for a customer (written by customer), i've got the instance on a local vm and can run the query in sql fine. If i save the view against the database and create a customisation and "CODE" to create the DAC, i get the sql view showing as a table i can select in a GI. when i run the query the correct number of rows is displayed. however, no actual data is being displayed and i am wondering if it's a "simple thing" i've missed in my setup or customisation?
i've tried running through the guide from tim's page acuCONNECT 2023 - Acumatica SQL View Examples with Generic Inquiries (augforums.com)
when i try and add a primary key, as [PXDBIdentity(IsKey = true)] for the shipment number
i get an error message below when the gi is run but before i get too far into casting various fields in different formats, anyone seen the "nothing in the table but returns rows" issue?
sql view below for anyone who wants to give it a try! are there any do's and don't re. alias' at all?
SELECT sos.ShipmentNbr, sosl.OrigOrderNbr, format(CURRENT_TIMESTAMP, 'ddMMyyyy') AS consignment_date, soc.FullName, soa.AddressLine1, soa.AddressLine2, soa.AddressLine3, soa.City, soa.PostalCode, soc.Phone1,
soc.Attention, 'XXX' AS delivery_instruction, SUM(sosl.ShippedQty * CAST(ISNULL(csa.Value, 0) AS decimal(6))) AS number_of_peices, SUM(sosl.ShippedQty * inv.BaseWeight) AS weight, 'CARTON (KG)' AS description,
CASE WHEN sos.shipvia = 'DXF3DAY' THEN '3D' ELSE 'ON' END AS service_level, sos.ShipVia AS actual_shipvia, sos.CompanyID
FROM dbo.SOShipment AS sos INNER JOIN
dbo.SOShipLine AS sosl ON sos.ShipmentNbr = sosl.ShipmentNbr AND sos.CompanyID = sosl.CompanyID INNER JOIN
dbo.SOAddress AS soa ON sos.ShipAddressID = soa.AddressID AND sos.CompanyID = soa.CompanyID INNER JOIN
dbo.SOContact AS soc ON sos.ShipContactID = soc.ContactID AND sos.CompanyID = soc.CompanyID INNER JOIN
dbo.InventoryItem AS inv ON sosl.InventoryID = inv.InventoryID AND sosl.CompanyID = inv.CompanyID LEFT OUTER JOIN
dbo.CSAnswers AS csa ON inv.NoteID = csa.RefNoteID AND inv.CompanyID = csa.CompanyID AND csa.AttributeID = 'IK4KCARTNO'
GROUP BY sos.ShipmentNbr, sosl.OrigOrderNbr, soc.FullName, soa.AddressLine1, soa.AddressLine2, soa.AddressLine3, soa.City, soa.PostalCode, soc.Phone1, soc.Attention,
CASE WHEN sos.shipvia = 'DXF3DAY' THEN '3D' ELSE 'ON' END, sos.ShipVia, sos.CompanyID
Can you post the DAC code? It seems like a Data Type problem with the Ship Via field. It wouldn't be a problem with the SQL View, but with the DAC code that sits on top of the SQL View.