SAP oData Service - How to link two entity sets - odata

In my first SAP fiori app I have created two entities in the odata Gateway in SAP backend. One for the main entity called 'Notification' and one for some value help field entity called 'Status'. Now I want to get the key of Notification when selecting the data for status entity so that each notification entity gets its individual Status value help depending on the key of the notification entity. How can i solve this?
Regards
Michael

I would suggest that you create an association for the two entities to connect them.

Related

Dynamics365 Operations: Created/Updated timestamps with Data Entities

I am new to Dynamics FnO, and recently followed the articles to access data through oData, and was successful.
What I see missing in the data objects that I normally receive in integrations out of the Microsoft World is the created/updated timestamps.
I am trying to put a synchronous data flow from FnO to my NodeJs application, so that my app keeps polling data from FnO whenever there is a change. This can be achieved easily if there were timestamps with the data that flows in.
Is there a way to setup those timestamps somewhere?
You have to make sure that the underlying table that you are querying has the fields added on it, and also that the data entity you are accessing through odata has the fields setup up on it as well.
Make sure this is setup on the table:
And then you have to drag and drop the field(s) from the datasource field list to the exposed field list in the data entity:
After this, you will have these fields

How to avoid duplicated records in core data - ios

I'm new in iOS, Swift. My application has one entity named "Category" in a relationship to many entities named "Movies".
"Movies" entities are changing, according to data that I get from a url. I'm looking for a way not to have duplicated movies records in each category, and I can't think of an easy way to do it.
Core-data does not have a built in way to ensure uniqueness. You have to manage that yourself. But it is not that hard. Before every insert/update do a fetch - if it does not exist then create it, it if already exists then update it. If you are updating many at a time (for example from a network request that has updates for many entities) then fetch all of then in a single fetch request and then create or update as needed.
Generally these fetches are done using uniqueIds for each entity. If you don't have any uniqueId for you entities then you have a deeper problem than core data. You could have two movies with the same name, or one movie that has different names. If you don't have anything that says the same, then you fundamentally don't have any way to know if you need to make another entity or update an existing one. It is possible that you can use the movie name, but I would not recommend that. I suggest that you look closer at your server api and see if there is a uniqueId that is served, and if there is none then you have to have it fixed by the server team.

accessing crm changes via odata

I am using odata to query Dynamics CRM Online 2013. I am trying to track changes against particular entities. For example, I want to be able to see Old Values and New Values for Opportunities, as you would see in the Summary View. Auditing is enabled for the entities but the most I can see via odata is whether a field of an entity was changed or not, and when it was changed.
Q. If "Change Tracking" is enabled will that expose another odata entity that will give me those changed values?
I am pretty sure Audit entity data is not exposed via OData.
Please find the url for the actual usage of Change Tracking feature.
http://www.powerobjects.com/2015/10/26/change-tracking-in-dynamics-crm-2015/
Audit table is not consumable through Sdk calls.. neither odata nor soap.
On premise will allow to query using sql queries but still data is "," "~" separated.
On the other hand Change tracking is accessible through sdk call using RetrieveEntityChangesRequest message. Pls refer the link below.
But this is for primary usage of integration services to identify the modified records for upstream/downstream systems from last cycle.
https://msdn.microsoft.com/en-us/library/dn932130.aspx
Update: Reg Audit, we have some limited options though - https://yanivrdt.wordpress.com/2016/01/08/retrieving-audit-history-records-via-api/

MVC design in iOS application similar to Whatsapp

I've been developing an application similar to Whatsapp (with its special features of course) and am now at the point where I think I should refactor all the existing code to make it conform with the MVC design pattern (because of too much glue code).
If I'll break my application to some simple stuff, we'll have:
First Message:
ID
Any Unread Message
Source User
Target User
Normal Message:
ID
First Message (weak reference)
Received State (Got to server/Got to client/Read by client)
Am i owner of message (am I source)
Date
User:
ID
Phone Number
Profile Image Link
Note the "Any Unread Message" should be ON if there are any messages the user didn't read. just an optimization from the server.
I've never really worked with the MVC design pattern properly so I would like to make sure that my plans are correct or perhaps there are additional/other stuff I should do.
I was thinking about:
Model:
Create a Core-Data xcdatamodel file which will hold the above entities
Use the library mogenerator to generate entity files from the core-data model
Create Data-Models for each operation. for example: Register Data-Model which will handle all the registration api with the server;
Message Data-Model which will handle sending a new message and
retrieving new messages; etc. All of these will be singleton.
View:
all the views of whatsapp like outer UITableViewController (to display unique users) and inner UITableViewController (to display
messages from a specific user).
Controller:
uses some of the above data models to fetch new data explicitly
I'm thinking to just give an API from the model to the controller which it can use it explicitly but that doesn't use the notifications or Key-Value-Observing designs.
I haven't found any online tutorial or document that explains what's the better thing to do.
Any suggestions?
Well I managed to successfully implement the MVC design pattern in my project by sticking to the theory - using notifications between the model and the controllers and using KVO between the views and the controllers.
:)

delete entities which are not represented on the server side

I want to remove all entities which are not represented on the server anymore (e.g when another client deletes it).
My current approach is to delete all entities from a specific type which are not returned after a query anymore:
Get and cache all local entities from specific type
Make the query
Compare old entities with new entities which are returned from the query and detach it from entity manager
This seems a little work for me and i wonder if there not an easier way (maybe breeze already has something) to do that?
It's a good question. We refer to these types of entities as "ghosts". They are entities that are queried from a server by one user and later deleted by another user. The entities on the first client have now become 'ghosts'.
We have an existing feature request that would automatically 'detach' these if and only if a primary key requery occurs. The reason for this is that unless the entity was fetched by primary key we cannot determine that it is a ghost. We have not yet implemented this feature but are considering it for one of the near term releases. Would this feature be of use to you?

Resources