-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamices crm annotations #411
Comments
Hi, |
Maybe it's good idea to write that rewriter for dynamics crm, because as I know, most developers use this library for communicating with web api endpoint |
That can make sense. Unfortunately I have never used Dynamics CRM, so I have no knowledge of what kind of annotations such rewriter should be aware of. |
I can send you examples if you are interested. Basicly it's just to receve string name of related entity (besides primary key) so you dont have to use expand if thats only field you need from related entity. And it's usefull because you can expand only one level so it saves you from looping and quering if you need two level expand for related entity name
On Jul 10, 2017, at 17:09, Vagif Abilov <[email protected]<mailto:[email protected]>> wrote:
That can make sense. Unfortunately I have never used Dynamics CRM, so I have no knowledge of what kind of annotations such rewriter should be aware of.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#411 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AOmyX-OcXM58rg473337BvtWjLfjqLSmks5sMj6NgaJpZM4OIYrn>.
|
This sounds like a candidate for the next major version upgrade. And it has to be opted in in a smart way, i.e. developers not using Dynamic CRM shouldn't be aware of that. But if you have a reference to documentated annotations as well as some examples, it's worth taking into account. |
As far as I know @OData.Community.Display.V1.FormattedValue is only field level annotation, as I sad, purpose id to get some string value along with guid or int id. Header to turn on this annotations is "Prefer: odata.include-annotations=OData.Community.Display.V1.FormattedValue" https://msdn.microsoft.com/en-us/library/gg334767.aspx#bkmk_includeFormattedValues |
Sorry, there's two more: @Microsoft.Dynamics.CRM.associatednavigationproperty and @Microsoft.Dynamics.CRM.lookuplogicalname |
and @odata.nextLink |
But this one is a part of OData spec. |
Any further thoughts on this? |
So far no progress, but I see this request is coming from several people, so I plan to start working on it. |
@object Isn't this already implemented seeing as https://github.com/OData/vocabularies/blob/master/OData.Community.Display.V1.md speaks of using it for property values? I can't find an example online on how to code it though. |
@object I need to get field-level annotations for Dynamics CRM. Could you provide a little more information about your suggestion earlier in this thread that someone could "intercept the response using custom rewriter"? I assume you mean to assign an action to ODataClientSettings.AfterResponse in order to intercept the response. If I do that, what I am going to do with the annotations to surface them in the value returned by FindEntriesAsync(annotations)? Any direction would be helpful. Thanks. |
@toryb I also can't find any examples on how to implement the odata.include-annotations defined in the odata web api docs @vladimirsakic did you find a solution? @object ODataClientSettings.AfterResponse is for the client side right ? But the server has to include other values in the response based on Display attributes. |
@flieks You are correct, the server does need to include annotations. This is done based on the request to include annotations in the prefer header of the request (i.e. Prefer: odata.include-annotations="*"). I have used the ODataClientSettings.BeforeResponse to add the request to the header so I get all annotations with each request. @vladimirsakic The way I have implemented the handling of CRM annotations is in the ODataClientSettings.AfterResponse. The way I handle them is to parse the content into a JObject and find the properties that contain an "@" (but don't start with "@"). Here is that line of code:
Then, by splitting the property name by '@' I get the property it applies to and the annotation to be applied:
There is probably much in there that needs explanation, but the essence of it is to search the response for field-level annotations and apply them to your implementation of the object as appropriate. I hope that helps. |
Any updates on this feature? |
Needing this here in 2024. Any ideas? |
dynamics crm odata service returns annotations like this one:
{
"@odata.count":1,
"value":[
{
"@odata.etag":"W/"1608905"",
"[email protected]":"Address Boulevard",
"_dot_propertyid_value":"9a11328b-5c15-e711-80e5-1458d043b558",
}
]
}
I have field _dot_propertyid_value, but how can I map to [email protected]
Thanks
The text was updated successfully, but these errors were encountered: