質問

私は、Dynamics CRMの4ワークフローからレコードのGUIDを取得する必要があります。これは、ワークフローの実行中に作成されたのレコードです。私が書い考えワット/ Fアセンブリ参照を受け入れ、(私の目的のために十分である)GUIDを含む文字列を返します。しかし、アセンブリ内の検索は、エンティティのタイプを指定する必要があります。要件は、すでに多くの企業のために存在するように、また予告なしに顧客が作成したEう多くの人のために、これはしません私のために働くます。

は簡単にこれを行うにはどのような方法、またはアセンブリそれがどのエンティティタイプを受け付けますワークフローの検索パラメータを作成する方法はありますか?

役に立ちましたか?

解決

あなたの最善の策はポストを作成するであろうことは、カスタムフィールド(new_myguid)にGUIDを設定し、その後、あなたのワークフローがすぐにそれが実行されているように、フィールドを読み取ることができますプラグインを作成ます。

他のヒント

あなたはネイティブワークフローデザイナーからのエンティティのIDにアクセスできないことやカスタムアクティビティを入力プロパティごとに単一のエンティティに限定されることを右です。

あなたがフォーカスの提案を実装することができますが、あなたにも、各エンティティにそのカスタム属性およびプラグインが必要と思います。

私はおそらく、カスタムアクティビティを行うと思うと、複数の入力特性を有している単一の出力プロパティにすべての出力ます。

このような何かます:

[CrmInput("Contact")]
[CrmReferenceTarget("contact")]
public Lookup Contact
{
    get { return (Lookup)GetValue(ContactProperty); }
    set { SetValue(ContactProperty, value); }
}
public static readonly DependencyProperty ContactProperty =
    DependencyProperty.Register("Contact", typeof(Lookup), typeof(YourActivityClass));

[CrmInput("Account")]
[CrmReferenceTarget("account")]
public Lookup Account
{
    get { return (Lookup)GetValue(AccountProperty); }
    set { SetValue(AccountProperty, value); }
}
public static readonly DependencyProperty AccountProperty =
    DependencyProperty.Register("Account", typeof(Lookup), typeof(YourActivityClass));

[CrmOutput("Entity ID")]
public string EntityID
{
    get { return (string)GetValue(EntityIDProperty); }
    set { SetValue(EntityIDProperty, value); }
}
public static readonly DependencyProperty EntityIDProperty =
    DependencyProperty.Register("EntityID", typeof(string), typeof(YourActivityClass));

protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
    Lookup[] lookups = new[] { Contact, Account };
    foreach (Lookup lookup in lookups)
    {
        if (lookup != null && lookup.Value != Guid.Empty)
        {
            EntityID = lookup.Value.ToString();
            break;
        }
    }

    return ActivityExecutionStatus.Closed;
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top