We are developing a JDBC driver for accessing F&O information using the F&O OData REST API. Our driver needs to be able to report precision information for each of the table columns such as max length for string value and decimal precision for numeric values.
This is what I'm using in PostMan to get the metadata followed by an example of what is being returned.
{{dataurl}}/data/$metadata
<?xml version="1.0" encoding="utf-8"?>
<edmx:DataServices>
<EntityType Name="ElectronicPaymentType">
<Key>
<PropertyRef Name="dataAreaId" />
<PropertyRef Name="PaymentType" />
</Key>
<Property Name="dataAreaId" Type="Edm.String" Nullable="false">
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.LabelId" String="@SYS13342" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.AXType">
<EnumMember>Microsoft.Dynamics.OData.Core.V1.AXType/String</EnumMember>
</Annotation>
</Property>
<Property Name="PaymentType" Type="Edm.String" Nullable="false">
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.LabelId" String="@GLS1280" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.CountryRegionCodes" String="BR" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.AllowEdit" Bool="false" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.IsRequired" Bool="true" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.AXType">
<EnumMember>Microsoft.Dynamics.OData.Core.V1.AXType/String</EnumMember>
</Annotation>
</Property>
<Property Name="MinimumTimeIncrement" Type="Edm.Decimal" Nullable="false">
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.LabelId" String="@SYS184028" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.ConfigurationKeyEnabled" Bool="true" />
<Annotation Term="Microsoft.Dynamics.OData.Core.V1.AXType">
<EnumMember>Microsoft.Dynamics.OData.Core.V1.AXType/Real</EnumMember>
</Annotation>
</Property>
</EntityType>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Here we can see the Edm.String property does not include max length for the field and the Edm.Decimal property does not include precision for the decimal value. Is there a way through the F&O OData REST API to query extended information for properties in the metadata such as max length for string values, precision on number value and column relationship information?
Dynamic 365 CRM does provides a way through the OData REST API to get extended metadata information about entities such as max length of string values, precision on number value, column relationship information and metadata changed timestamp information but I have not been able to find any documentation for obtaining similar information for Dynamics 365 F&O metadata entities.