2014-11-05 51 views
0

我想根據以下標準檢索以下自定義工作流程Contacts在自定義工作流的參數中列出<>?

[Input("Retrieve customers whose renewal date is lesser or equal than today + X days")] 
public InArgument<int> Days { get; set; } 

[Input("For which service?")] 
public InArgument<string> Service { get; set; } 

而且我希望它返回如下:

[Output("Customers up for renewal")] 
public OutArgument<List<Contact>> Customers{ get; set; } 

我的想法是,另一個工作流步驟將通過這一工作流程什麼回報(Customers)循環。

但當我註冊了裝配,上述步驟無法註冊,因爲:

The type OutArgument`1 of the property Customers is not supported 

支持哪些類型的參數呢? MSDN沒有告訴我多少,是我返回一個列表錯誤的概念還是一個工作流程一次只能處理一條記錄?

謝謝。

回答

2

自定義工作流程活動可以使用OutArgument只有一組類型,並且沒有類型(例如EntityCollection)將多個項目作爲單個OutArgument返回。

因爲您想要返回Contact的列表,所以可以使用靜態Marketing List作爲解決方法。

內,您的自定義工作流活動創建一個新的市場營銷列表,並把聯繫人的列表的成員(市場營銷列表只能與聯繫人使用,賬戶或潛在客戶),並作爲EntityReference返回列表編號:

[Output("List of Contacts")] 
[ReferenceTarget("list")] 
public OutArgument<EntityReference> MarketingListRef { get; set; } 


// code to create the marketing list and add the contacts 
Guid marketingListId; 

// set the OutArgument 
EntityReference marketingListRef = new EntityReference("list",marketingListId); 
MarketingListRef.Set(executionContext, marketingListRef); 
0

我找到屬性here的支持類型列表。我想我將不得不重組我的工作流程,以便在內部處理Customers的列表,因爲此列表不會顯示給其他工作流程步驟。

+0

您可以返回包含聯繫人的新靜態營銷列表。也許不是最佳的,不知道你的整個情況,但沒有工作 – 2014-11-05 16:45:42

+0

@GuidoPreite你可以詳細解釋一個答案嗎?我在上面發佈的MSDN鏈接中看不到這種類型。謝謝。 – 2014-11-05 16:51:00

相關問題