AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Everything Else
SQL View not displa...
 
Notifications
Clear all

Questions SQL View not displaying values

 
Everything Else
Last Post by matthewjames 1 year ago
3 Posts
2 Users
1 Reactions
663 Views
RSS
matthewjames
Posts: 39
 matthewjames
Topic starter
March 6, 2024 12:16 pm
(@matthewjames)
Trusted Member
Joined: 5 years ago

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?

image

 

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

Topic Tags
u
2 Replies
Tim Rodman
Posts: 3192
 Tim Rodman
Admin
March 23, 2024 11:27 pm
(@timrodman)
Famed Member
Joined: 10 years ago

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.

Reply
matthewjames reacted
matthewjames
 matthewjames
(@matthewjames)
Joined: 5 years ago

Trusted Member
Posts: 39
March 27, 2024 8:38 am
Reply toTim RodmanTim Rodman

@timrodman hi Tim, thanks for the reply, we've given that one up as a learning excercise as i managed to get what they needed through straight GI rather than have to have a custom SQL view. 

 

Reply
Forum Jump:
  Previous Topic
Next Topic  
Topic Tags:  u (1) ,
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,518 Topics
  • 10.9 K Posts
  • 5 Online
  • 2,309 Members
Our newest member: Jason Rhodes
Latest Post: Table linkage for adding a customer location note to the SO Shipment form
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Nathan Deardorff
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×