How to make use of navigation property?

Navigation properties are, as the name suggests, properties with which you can navigate to related entity types. The UI5 framework supports this feature too so that app developers don’t have to extract URLs by hand. In fact, you won’t even need to call read. Let’s take this entity data model for example: CustomerSet NavigationProperty: “ToOrders” … Read more

How to get model on onInit?

You can avoid setTimeout, as mentioned in this answer, by using the v2.ODataModel API metadataLoaded instead which returns a promise. The promise is fulfilled once the service metadata is loaded successfully. onInit: async function() { const oPayerModel = this.getOwnerComponent().getModel(“SalesInvoices”); try { await oPayerModel.metadataLoaded(true); const oServiceMetadata = oPayerModel.getServiceMetadata(); // NOT .getMetadata() // … } catch (oError) … Read more