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
For REST API, does ...
 
Notifications
Clear all

Questions For REST API, does DAC need a single key field?

 
Everything Else
Last Post by Tim Rodman 7 years ago
4 Posts
2 Users
0 Reactions
3,593 Views
RSS
Tim Henning
Posts: 7
 Tim Henning
Topic starter
October 31, 2018 4:44 pm
(@tim-henning)
Member
Joined: 7 years ago

For REST API, does DAC need a single key field?

I have performed these steps:

1. Created an adhoc SQL query and published it to the Acumatica server. 

2. Created a DAC and Generic Inquiry from that published view.  It returns data.

3. Created a Web Service Endpoint.

4. Tested the endpoint from Postman.  I can get a response for the $adHocSchema GET request. 

When I perform a getList request, I get the  "PX.Api.ContractBased.OptimizedExport.CannotOptimizeException" message.  I have not applied the 'isKey' attribute to any of the DAC fields because the view really has a multi-field key result.  e.g. CompanyID/InvoiceRuleID/BillingRuleID is the key.  These are returned in the result.

Should I create a virtual field of the fields and make that the key?

Thanks,

Tim


3 Replies
Tim Henning
Posts: 7
 Tim Henning
Topic starter
November 1, 2018 9:05 am
(@tim-henning)
Member
Joined: 7 years ago

I have applied the "isKey" attribute to all of the key fields in the DAC.  Using Postman, I have successfully retrieved data using a PUT verb and entering a filter parameter value in the body.

{
"CompanyCD" : {"value": "<some value>"}
}

 


Reply
Tim Henning
Posts: 7
 Tim Henning
Topic starter
November 2, 2018 4:12 pm
(@tim-henning)
Member
Joined: 7 years ago

If your API is readonly, you can use ODATA call to return REST response.  It returns a nice flat array structure that works nicely in JavaScript.

GET /OData/<CompanyCd>/<Your GI> HTTP/1.1

Header:  Accept: application/json

Tim

 


Reply
Tim Rodman
Posts: 3199
 Tim Rodman
Admin
November 7, 2018 7:11 am
(@timrodman)
Famed Member
Joined: 10 years ago

Wow, very interesting. Thanks for sharing this Tim. Just curious, do you see an advantage to using the web service endpoint to get the JSON over using the OData path to return JSON like in this post?

https://www.augforums.com/augforums/acumatica-odata-with-microsoft-excel-and-power-bi/using-json-with-odata-in-acumatica/


Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,528 Topics
  • 10.9 K Posts
  • 17 Online
  • 2,412 Members
Our newest member: Peter Paasch
Latest Post: Tax on Inventory Transfer
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

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

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

‹›×

    ‹›×