zoukankan      html  css  js  c++  java
  • Plugin Message 初步。转自http://dmcrm.blogspot.com/2008/08/starterexecutionmethod.html

    Starter Execution Method:

    public void Execute(IPluginExecutionContext context)
    {
    string opportunityid = "";

    switch(context.MessageName)
    {
    case "Create":
    if (context.OutputParameters.Properties.Contains("id"))
    {
    opportunityid = context.OutputParameters.Properties["id"].ToString();
    }
    break;
    case "Update":
    if (context.InputParameters.Properties.Contains(ParameterName.Target) && context.InputParameters.Properties[ParameterName.Target] is DynamicEntity)
    {
    DynamicEntity entity = (DynamicEntity)context.InputParameters.Properties[ParameterName.Target];
    opportunityid = ((Key)entity.Properties["opportunityid"]).Value.ToString();
    }
    break;
    case "SetState":
    if (context.InputParameters.Properties.Contains("EntityMoniker"))
    {
    if (context.InputParameters.Properties.Contains("State"))
    {
    entity = (Moniker)context.InputParameters.Properties[ParameterName.EntityMoniker];
    opportunityid = entity.Id.ToString();
    }
    }
    break;
    case "SetStateDynamicEntity":
    if (context.InputParameters.Properties.Contains("EntityMoniker"))
    {
    if (context.InputParameters.Properties.Contains("State"))
    {
    entity = (Moniker)context.InputParameters.Properties[ParameterName.EntityMoniker];
    opportunityid = entity.Id.ToString();
    }
    }
    break;
    case "Win":
    opportunityClose = (DynamicEntity)context.InputParameters["OpportunityClose"];
    Lookup WonLook = (Lookup)opportunityClose.Properties["opportunityid"];
    opportunityid = WonLook.Value.ToString();
    break;
    case "Lost":
    opportunityClose = (DynamicEntity)context.InputParameters["OpportunityClose"];
    Lookup LostLook = (Lookup)opportunityClose.Properties["opportunityid"];
    opportunityid = LostLook.Value.ToString();
    break;
    case "Assign":
    if (context.InputParameters.Properties.Contains("Assignee") && context.InputParameters.Properties["Assignee"] is SecurityPrincipal)
    {
    Moniker assignEntity = (Moniker)context.InputParameters.Properties["Target"];
    opportunityid = assignEntity.Id.ToString();
    }
    break;
    case "Delete":
    if (context.InputParameters.Properties.Contains("Target"))
    {
    Moniker monikerentity = null;
    monikerentity = (Moniker)context.InputParameters.Properties[ParameterName.Target];
    opportunityid = monikerentity.Id.ToString();
    }
    break;
    }
    }

    MessageName Class (CrmHelpers)

    AddItem
    AddMember
    AddMembers
    AddMembersByFetchXml
    Assign
    Book
    Clone
    CompoundCreate
    Create
    Delete
    DeliverIncoming
    DeliverPromote
    ExecuteWorkflow
    ExecuteWorkflow
    GrantAccess
    Handle
    Lose
    Merge
    ModifyAccess
    RemoveItem
    RemoveMember
    RemoveMembers
    RemoveMembersByFetchXml
    Reschedule
    Retrieve
    RetrieveExchangeRate
    RetrieveMultiple
    RetrievePrincipalAccess
    RetrieveSharedPrincipalsAndAccess
    RevokeAccess
    Route
    Send
    SetState
    SetStateDynamicEntity
    Update
    Win
  • 相关阅读:
    CSS伪元素:before/CSS伪元素:before/:after content 显示Font Awesome字体图标:after content 显示Font Awesome字体图标
    window.requestAnimationFrame
    HTML5 canvas clearRect() 方法
    canvas save()和canvas restore()状态的保存和恢复使用方法及实例
    git -分支管理(创建、推送、删除)
    微信小程序设置域名、不校验域名
    微信小程序访问豆瓣api403问题解决方发法
    干货:Vue粒子特效(vue-particles插件)
    chmod命令详细用法
    Python新式类和旧式类的区别
  • 原文地址:https://www.cnblogs.com/janmson/p/1490405.html
Copyright © 2011-2022 走看看