accessing crm changes via odata - 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/

Related

Microsoft Graph Intune: How to get the "enrolled by" user data

In Azure portal on a managed device detail page it shows two types of users,
The "Primary" user and the "Enrolled by" user. I'm trying to figure out how I can retrieve the latter
using the Microsoft Graph API. What I've tried so far is pretty much every managed device related API.
The ones I mainly use are the https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-list?view=graph-rest-1.0 and https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-get?view=graph-rest-1
I've also looked at pretty much all the beta variants of the related API documentation if and when they are available. My problem is that it seems like there is no way to retrieve this information.
You have to query the related object of the managed device
https://graph.microsoft.com/beta/devicemanagement/manageddevices/b32d84d4-50da-469f-a65d-2f1c30f8da67/users
Also you will get object id of the primary owner.
https://www.youtube.com/watch?v=CTEs_lHtZJ4&list=PL8wOlV8Hv3o9TUJxUR9T78TevVjtsRAup&ab_channel=ConceptsWork
https://www.youtube.com/watch?v=yw5Cz5rO6_Y&list=PL8wOlV8Hv3o_KgAx8JmnqM4G97U0vPR9l&ab_channel=ConceptsWork

Microsoft Graph educationClass expand with select

I'm trying to grab only properties "id" and "userPrincipalName" from the teacher when getting educationClasses with $expand=teacher as parameter. But whatever I do, I keep getting the full teacher/user object.
https://graph.microsoft.com/v1.0/education/classes?$expand=teachers($select=id,userPrincipalName)
But it gives the same result as this one:
https://graph.microsoft.com/v1.0/education/classes?$expand=teachers
What am I doing wrong?
Or is this one of the endpoints where the expand+select feature is not fully supported? I don't want the full teacher object because it contains assignedLicenses, assignedPlans, provisionedPlans and a whole lot of stuff I will never need in this request.
And...it's production, so I'd like to avoid using the BETA endpoint if possible.
Yep, looks like the underlying AAD storage doesn't support expand plus select.
You can see what is happening under the covers by appending the &$whatif to your query.
Not a lot we can do about this, as the AAD team aren't investing in adding richness here right now.

VSTS OData - get comments from Work Item

I am trying to query the VSTS OData endpoint from Power BI to get the comments from [Discussion] section inside a Work Item.
It seems that this [Discussion] child entity is not exposed in the data model
(as described here: https://learn.microsoft.com/en-us/vsts/report/extend-analytics/data-model-analytics-service?view=vsts)
Does anyone know if it can be accessed from OData query or in any other way?
P.S.
Another way to do it may potentially be adding a custom text field inside a Work Item and moving all comments there, however, I am not sure if these fields are exposed in OData endpoint as well and can be accessed by means of querying.
I would be really grateful if anyone could share any information on that topic as well.

How to enable Watson conversation service to use your own database for serving user's request

I want to build a smart search agent which would use Watson conversation to process the request and give response but will use my own database say SQL server to search the desired output.
In Short Instead of writing intents and dialogues manually or importing from a csv file, I want to write my won code in .net in such a way that all the request and responses are influenced by my own data stored in my database. I only intent to use watson's processing and interpreting capability. But the processing must happen on my data.
E.g If the user searches for a word say "Dog", the Watson conversation service must search in my database and give relevant answers to the user based on the search.
Take a look at the solution architecture in the Watson Conversation documentation. Your database would be one of the depicted backend systems. Your application would be, as you mentioned, written in .NET and would use WCS to process the user input. It would return a response with all the associated metadata. Instead of having complete answers configured in a dialog, you would use something I have described as "replaced markers" in my collection of examples. Those markers are kind of hints to your application of which database query or which action to perform.
Note that WCS requires some intents and entities to work on. If you want to rely just on the detected intents and entities, you could work with one or two generic dialog nodes. As another technique you could use data from your database to generate intents and entities as an initial setup. In my "Mutating EgoBot" I use the Watson Conversation API to add intents and entities on the fly.
I believe you should use the standard trick:
instead of defining resposnses in the node of your diaglog, define an action on the output object of the node and let your applicatation take care of providing response (see https://console.bluemix.net/docs/services/conversation/develop-app.html#building-a-client-application)

Database Audit Log using Triggers - User information

I'm contemplating using AFTER INSERT, DELETE, UPDATE Triggers to capture changes to one of my databases. One thing I want is to capture name of the user who made the change.
Since I'm using a dedicated SQL account to connect to the database (from ASP.NET MVC), I don't believe SUSER_SNAME() will provide accurate information to me.
Is there anyway for me to feed in the username from ASP.NET MVC side to the trigger?
ASP.NET side is configured for Windows Authentication against Active Directory.
Take a look at Set Context_Info. I've used this successfully in the past when auditing and using sql authentication. The idea is that you set the in the context the logged on user, then in the DB Trigger you retrieve this info from the context and store it in the DB. If you forget to set the user in the context, you can always fall back to suser_name (although, not very useful for auditing, but can be useful when making changes directly in SSMS). Google "Audit Trail Set Context_Info" and you will find some examples.
Like this one and this other one
You could use Thread.CurrentPrincipal to get the Windows Account and pass this as a parameter to your queries, and therefore, available to Triggers.
var userName = Thread.CurrentPrincipal.Identity.Name;

Resources