When attempting to write reference links on deep insert as seen here, it throws on #ToDictionary(...) for navigation keys that per the schema have Nullable=false, but you can actually omit them and let the API generate them (we disable validations).
Take for example schema:
<EntityType Name="purchaseInvoice">
<Key>
<PropertyRef Name="documentType" />
<PropertyRef Name="no" />
</Key>
<Property Name="documentType" Type="Edm.String" Nullable="false" />
<Property Name="no" Type="Edm.String" Nullable="false" MaxLength="20" />
<NavigationProperty Name="purchaseInvoiceLines" Type="Collection(Microsoft.NAV.purchaseInvoiceLine)" Partner="purchaseInvoice" ContainsTarget="true">
<ReferentialConstraint Property="documentType" ReferencedProperty="documentType" />
<ReferentialConstraint Property="no" ReferencedProperty="documentNo" />
</NavigationProperty>
</EntityType>
documentType and no can be omitted and generated by the API (despite being non-nullable per schema), however, when deep inserting with purchaseInvoiceLines, it attempts to create links and fails as it can not get them.
Anyone have any workaround that does not include having to insert invoice lines one by one?
When attempting to write reference links on deep insert as seen here, it throws on #ToDictionary(...) for navigation keys that per the schema have
Nullable=false, but you can actually omit them and let the API generate them (we disable validations).Take for example schema:
documentTypeandnocan be omitted and generated by the API (despite being non-nullable per schema), however, when deep inserting withpurchaseInvoiceLines, it attempts to create links and fails as it can not get them.Anyone have any workaround that does not include having to insert invoice lines one by one?