ワークフロー デザイナーからエンティティ ID にネイティブにアクセスすることはできず、カスタム アクティビティは入力プロパティごとに 1 つのエンティティに制限されることは間違いありません。
Focus の提案を実装することもできますが、各エンティティにもそのカスタム属性とプラグインが必要です。
私はおそらくカスタム アクティビティを実行し、すべてが単一の出力プロパティに出力される複数の入力プロパティを持っていると思います。
このようなもの:
[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;
}