web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Odata and composite keys in URL

(0) ShareShare
ReportReport
Posted on by

Hello to everyone,

I'm new to the Forum and quite new to OData.
I'm working on the integration of our front-end application to the Navision enviroment (developed by a Microsoft partner). 
I need to get a single record from a table. The table is made up by this fields:

<EntityType Name="DownloadBasket">
<Key>
<PropertyRef Name="Basket_No"/>
<PropertyRef Name="Customer_No"/>
<PropertyRef Name="Download_Date"/>
<PropertyRef Name="Item_No"/>
<PropertyRef Name="Location_Code"/>
<PropertyRef Name="Variant_Code"/>
</Key>
<Property Name="Basket_No" Type="Edm.String" Nullable="false"/>
<Property Name="Download_Date" Type="Edm.DateTime" Nullable="false"/>
<Property Name="Customer_No" Type="Edm.String" Nullable="false"/>
<Property Name="Location_Code" Type="Edm.String" Nullable="false"/>
<Property Name="Item_No" Type="Edm.String" Nullable="false"/>
<Property Name="Variant_Code" Type="Edm.String" Nullable="false"/>
<Property Name="Quantity" Type="Edm.Int32"/>
<Property Name="Description" Type="Edm.String"/>
<Property Name="WineMaker_Name" Type="Edm.String"/>
<Property Name="ETag" Type="Edm.String" ConcurrencyMode="Fixed"/>
</EntityType>
The url I'm trying to reach:
../DownloadBasket(Basket_No='E1507028469559',Download_Date='2017-10-03T11:01:09.56Z',Customer_No='C00250',Item_No='V00138',Variant_Code='2016',Location_Code='SAPORI SOL')

The answer I get:

Bad Request - Error in query syntax

What I'm doing wrong?

Thank you

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Zaid Tariq Profile Picture
    2,274 on at

    Hi,

    I guess the issue is with the date format, had you tried changing the date format? Also make sure that the field size must be greater or equal to the size of the string.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans