OData - AccumulationRegister - Balance



1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Sep 18, 2012
Company:

Hello everyone,
I published Odata service.
When I am trying to get:

Code
.../odata/standard.odata/AccumulationRegister_PartnersSettlements?$top=10

then I receive top 10 records from PartnersSettlemtns register. It works fine.
But when I am trying to get:
Code
.../odata/standard.odata/AccumulationRegister_PartnersSettlements_Balance?$top=10

then I receive error:
Code
Entity not found.

Why? How can I get information from Balance virtual table using Odata?
A bit more information from
Code
...odata/standard.odata/$metadata

for normal register table and Balance table and FunctionImport (how to call this FunctionImport?)
Code
<EntityType Name="AccumulationRegister_PartnersSettlements" OpenType="true">
<Key>
<PropertyRef Name="Recorder"/>
<PropertyRef Name="Recorder_Type"/>
</Key>
<Property Name="Recorder" Type="Edm.String" Nullable="false"/>
<Property Name="RecordSet" Type="Collection(StandardODATA.AccumulationRegister_PartnersSettlements_RowType)" Nullable="false"/>
<Property Name="Recorder_Type" Type="Edm.String" Nullable="false"/>
</EntityType>

Code
<ComplexType Name="AccumulationRegister_PartnersSettlements_Balance">
<Property Name="Company_Key" Type="Edm.Guid" Nullable="true"/>
<Property Name="Partner" Type="Edm.String" Nullable="true"/>
<Property Name="Document" Type="Edm.String" Nullable="true"/>
<Property Name="Currency_Key" Type="Edm.Guid" Nullable="true"/>
<Property Name="SettlementType" Type="Edm.String" Nullable="true"/>
<Property Name="ReservationDocument" Type="Edm.String" Nullable="true"/>
<Property Name="AmountBalance" Type="Edm.Double" Nullable="true"/>
<Property Name="AmountNationalBalance" Type="Edm.Double" Nullable="true"/>
<Property Name="Partner_Type" Type="Edm.String" Nullable="true"/>
<Property Name="Document_Type" Type="Edm.String" Nullable="true"/>
<Property Name="ReservationDocument_Type" Type="Edm.String" Nullable="true"/>
</ComplexType>

Code
<FunctionImport Name="Balance" IsBindable="true" IsSideEffecting="false" ReturnType="Collection(StandardODATA.AccumulationRegister_PartnersSettlements_Balance)">
<Parameter Name="bindingParameter" Type="StandardODATA.AccumulationRegister_PartnersSettlements"/>
<Parameter Name="Condition" Type="Edm.String"/>
<Parameter Name="Dimensions" Type="Edm.String"/>
<Parameter Name="Period" Type="Edm.DateTime"/>
</FunctionImport>


I need to get info from Balance table but I don't know how to do it. Thank you in advance for all your help.
Kris

 
#2
People who like this:0Yes/0No
Administrator
Rating: 16
Joined: Dec 4, 2017
Company:

Dear Kris,

If you want to address to a virtual table of an accumulation register, you should use the following format:

http://host/base/odata/standard.odata/<resource>/<function>(<parameters>)


In you instance,

- <resource> is the name of the accumulation register
- <function> is the name of the virtual table
- <parameters> is a sequence of the Key=Value pairs, where individual pairs are separated with commas

If you want to use a selection as a parameter of the function, then the expression that describes the selection must meet the following common rules of describing selections:

http://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/ (10.2.3.1. The $filter System Query Option)

http://www.odata.org/documentation/odata-version-3-0/url-conventions/ (5.1.2. Filter System Query Option)


For instance, if you address to the "Balance" virtual table of the "PartnersSettlements" accumulation register, you can use a selection like this:

.../odata/standard.odata/AccumulationRegister_PartnersSettlements/Balance(Period=datetime'2018-01-01T00:00:00',Condition='Currency_Key eq guid'value'')

Best regards,
Vladimir Gurov

1C Company support team
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)