2010-03-31 3 views
0

Dynamics CRM 4 워크 플로에서 레코드의 GUID를 가져와야합니다. 워크 플로가 실행되는 동안 만들어진 레코드입니다. 조회를 허용하고 GUID를 포함하는 문자열을 반환하는 w/f 어셈블리를 작성하는 것을 생각했습니다 (이는 내 용도로 충분합니다). 그러나 어셈블리의 조회는 엔터티 유형을 지정해야합니다. 요구 사항이 이미 많은 엔티티에 존재하며, 통지없이 고객이 작성하게 될 많은 다른 것들에 대해서는 이것이 작동하지 않습니다.CRM 워크 플로에서 레코드의 GUID를 가져올 수 있습니까?

쉽게 수행 할 수있는 방법이 있습니까, 아니면 엔티티 유형을 허용 할 워크 플로 어셈블리의 조회 매개 변수를 만드는 방법이 있습니까?

답변

1

가장 좋은 방법은 GUID를 사용자 정의 필드 (new_myguid)로 설정하는 게시 작성 플러그인을 작성한 다음 워크 플로우가 실행되는 즉시 필드를 읽을 수 있도록하는 것입니다.

+0

그래, 나는 결국에 무슨 일이 있었는지입니다. –

1

기본적으로 워크 플로 디자이너의 엔터티 ID에 액세스 할 수 없으며 사용자 지정 작업이 입력 속성마다 단일 엔터티로 제한된다는 것이 옳습니다.

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; 
} 
+0

엔티티가 미리 알 수 없으므로 작동하지 않습니다. –

관련 문제