简体   繁体   English

Acumatica REST-CustomerLocation实体不返回记录

[英]Acumatica REST - CustomerLocation entity does not return records

Using REST API, able to pull down customers, contacts, and addresses via the Customer entity, however, when I try to get CustomerLocation entities, I am just getting an empty set. 使用REST API,能够通过Customer实体提取客户,联系人和地址,但是,当我尝试获取CustomerLocation实体时,我得到的只是一个空集合。

[]

Using latest version as of the writing of this question (2018R1 dated something like Aug 17 2018). 使用截至本问题写作的最新版本(2018R1日期类似于2018年8月17日)。

I've tried the following: 我尝试了以下方法:

CustomerLocation?$expand=LocationContact

CustomerLocation?$expand=LocationContact,LocationContact/Address

Neither of them return any data. 他们都不返回任何数据。

The CustomerLocation entity is linked to a Generic Inquiry that is defined to allow creation of new records, so it was causing an error trying to persist the data when trying to do a Put to it since I was not supplying a body or a valid structure. CustomerLocation实体链接到一个通用查询,该通用查询被定义为允许创建新记录,因此由于我未提供主体或有效结构,因此在尝试Put数据时试图保存数据会导致错误。

How I got this to work was to create my own Generic Inquiry, linking it to an entity in my extended endpoint, and adding a Detail property within the entity that would serve as the collection of detail records returned by the Generic Inquiry. 我如何使它起作用的方法是创建自己的通用查询,将其链接到扩展端点中的实体,然后在实体内添加一个Detail属性,该属性将用作通用查询返回的详细记录的集合。 Then put all of the fields from the Generic Inquiry within the Results Fields. 然后将“一般查询”中的所有字段放入“ Results字段中。

添加结果属性

将通用查询返回字段添加到结果内部的字段

Now, I can get the records from the Generic Inquiry by doing a Put request via my endpoint entity: AICustomerLocationGI?$expand=Results 现在,我可以通过端点实体通过执行Put请求从通用查询中获取记录: AICustomerLocationGI?$expand=Results

Note: It's important to do a Put instead of a Get if you want to avoid getting BQL Delegate errors on some DACs. 注意:如果要避免在某些DAC上出现BQL委托错误,那么执行Put而不是Get至关重要。

That returned all records at once, but got me where I initially needed to be. 那一次返回了所有记录,但让我到达了最初需要的位置。 Next, I added a parameter, Greater Than condition, and sorting on Address ID to the Generic Inquiry and defined the generic inquiry to return the top 100 records. 接下来,我向“通用查询”添加了一个参数“大于条件”,并对“地址ID”进行了排序,并定义了通用查询以返回前100条记录。 By passing the last Address ID of the previous batch of records in the body of the Put request, this gave me a paging mechanism for returning the records. 通过在Put请求的主体中传递前一组记录的最后一个地址ID,这为我提供了一种用于返回记录的分页机制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM