English 中文(简体)
如何知道在动态 CRM 插件背景下, 输入量计值是多少?
原标题:How to know what InputParameters values are possible in Dynamics CRM Plugin context?
我试图从这里理解插件样本 。 这样的条件 : / / / / 输入Parameter 收藏包含在信息请求中通过的所有数据 。 如果 (comtext. InputParamets. Contains (“ target” ) \\ 上下文 。 InputParamets (“ target” ) 是实体 。 InputParamets (“ Target” ) 是实体 。 。 InputParaters (“ TargetPet” ) 是实体 。 一般来说, 我试图从这里理解插件, 不仅仅是这个样本, 我应基于什么先前的知识来决定访问特定属性 。 输出Paramets 取决于信息是否包含“ target” 键 (我假设我不应该猜测它 )?? 并且基于什么基础的“ targregetPara ” 显示“ table ” 显示“ table ” 阶段, 我的输出PardPards is a pristressional strations be a prime strate strations be a pristate: ( strate) shown.
最佳回答
The best practice for doing this is to use a strongly typed approach. If, for example, you want to know which propertes are available on a CreateRequest, you would do: var createReq = new CreateRequest() { Parameters = context.InputParameters }; createReq.Target; // Has type Entity Take a look at the full blog post explaining this approach: Tip: Proper handling of Plugin InputParameters Original answer: It depends on which request we are talking about. See Understand the data context passed to a plug-in on MSDN. As an example, take a look at CreateRequest. One property of CreateRequest is named Target, which is of type Entity. This is the entity currently being operated upon by the platform. To access the data of the entity you would use the name “Target” as the key in the input parameter collection. You also need to cast the returned instance. Note that not all requests contain a Target property that is of type Entity, so you have to look at each request or response. For example, DeleteRequest has a Target property, but its type is EntityReference. In summary: Look at the actual request, e.g the CreateRequest.
问题回答
I know this is an "old" question that already has been answered, but I think this can be helpful. I ve built a small web page that contains all the messages with all the Input/Output parameters. You can access it from here:
In 2011 someone actually generated typed properties based on the message type. Kind of neat: https://xrmpalmer.wordpress.com/2013/05/27/crm2011-plugin-inputparameter-and-outputparameter-helper/ It would show you want parameters are possible per message.
\For Future Search \For D365 Online switch (stepAttribute.Message) { case "Create": image.MessagePropertyName = "Id"; break; case "SetState": case "SetStateDynamicEntity": image.MessagePropertyName = "EntityMoniker"; break; case "Send": case "DeliverIncoming": case "DeliverPromote": image.MessagePropertyName = "EmailId"; break; default: image.MessagePropertyName = "Target"; break; }




相关问题
Creating a PDF of a Dynamics CRM 4.0 report programmatically

We are currently in the midst of upgrading our CRM 3.0 installation to CRM 4.0. One of the things we were doing from our external web site is pulling a PDF of a report using the ReportViewer control ...

"required field EntityId is missing" error

No matter what i attempt i keep getting the following exception being thrown by MSCRM 4.0 Invalid format of input XML for request SetStateITG_glcode: required field EntityId is missing here is ...

Microsoft Dynamics CRM 4.0 and Identity Lifecycle Management

Customers are stored in Dynamics CRM 4.0 an some need access to external facing application and therefore should be provisioned in the DMZ Active Directory. Does it make sense to use MS Identity ...

热门标签