简体   繁体   English

如何格式化Dynamics 365 C#插件的LINQ查询

[英]How to format LINQ query for Dynamics 365 c# plugin

I am looking to create ac# plugin that runs when a field is updated. 我正在寻找创建在字段更新时运行的ac#插件。 I am a little confused on how to format a LINQ query to interact with dynamics 我对如何格式化LINQ查询以与动态交互感到困惑

I have a Dynamics entity called bname_jobs which I need to query. 我有一个名为bname_jobs的动力学实体,需要查询。

looking at some code currently sitting within the business the LINQ starts off with 查看LINQ中当前存在的业务中的一些代码

var processlineitems = from processLineItem in xrm.bname_processlineitemSet

My question is how do I find out the names of the entity I want to query in the above format 我的问题是如何以上述格式查找要查询的实体的名称

I need to fill in the x's in the below code 我需要在下面的代码中填写x

var jobs = from xxxx in xrm.bname_xxxxxxxx

To query a Dynamics 365 Entity ther are various ways. 要查询Dynamics 365实体,有多种方法。

  1. Query Expression 查询表达
  2. Fetchxml Expression Fetchxml表达式

When writing code in c# in most of the case, I have seen developers go with query expression. 在大多数情况下,用c#编写代码时,我已经看到开发人员会使用查询表达式。

Few examples with query expression and d365 几个带有查询表达式和d365的示例

Example 1 例子1

Example 2 例子2

Now how to find Entity name, in your context you are looking for entity schema name. 现在,如何查找实体名称,在您的上下文中,您正在寻找实体架构名称。

Go to CRM (UI)--> Advanced Settings--> Settings-->Customization-->Cutomize the system( It will open default solution)--> Entites on left hand side--> select your entity. 转到CRM(UI)->高级设置->设置->自定义->定制系统(它将打开默认解决方案)->左侧的实体->选择您的实体。

Images below will show you how to direct 以下图片将向您展示如何指导

在此处输入图片说明

在此处输入图片说明

In this case my Entity display name is "Case" but it's schema name is "incident". 在这种情况下,我的实体显示名称为“ Case”,但其架构名称为“ incident”。

This is what you need to query in your querexpression or fetchxml 这是您需要在querexpression或fetchxml中查询的内容

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Dynamics 365 C# 插件中查询用户的团队? - How do I query a user's teams in Dynamics 365 C# plugin? 具有多个联接的Dynamics 365 OrganisationServiceContext Linq查询 - Dynamics 365 OrganizationServiceContext Linq Query with multiple Joins Dynamics 365 - Linq 查询不存在条件 - Dynamics 365 - Linq query with a not exists condition 如何在带有C#插件的Dynamics CRM组织中使用Dynamics 365 Web API检索所有记录(超过5000页和/或一页以上)? - How can I retrieve all records (more than 5000 and/or more than 1 page) with the Dynamics 365 Web API in a Dynamics CRM organization with a C# plugin? 如何在 dynamics c# 插件中使用 google lib-phonenumbers - How to use google lib-phonenumbers in dynamics c# plugin 如何在特定字段值上触发动态 c# 插件 - How to fire a dynamics c# plugin on specific field value 如何在LINQ中查询? C# - How to query this in LINQ? C# 如何通过使用C#代码在Microsoft Dynamics 365中附加注释中的图像(注) - How to attach Image in Annotation(Note) in Microsoft Dynamics 365 By using C# code 如何使用C#将多重身份验证登录到Dynamics 365 - How to login Multi-Factor Authentication to Dynamics 365 using C# c# OdataClient:DataServiceActionQuery,如何执行Microsoft Dynamics 365 Business Central 的功能? - c# OdataClient: DataServiceActionQuery, how to execute a function Microsoft Dynamics 365 Business Central?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM