0

車の詳細エンティティに 2 つの選択リストがあります。カスタム ワークフロー アクティビティの入力パラメーター (CrmNumber) からモデル (cir_model)ピックリスト値を設定していますが、期待どおりに機能しており、モデルピックを使用して 2 番目のピック リストマーク (cir_marque)が論理的に設定されます。リスト。

ロジックは、Modelが「Ac Ace」に設定されている場合、 Marqueが「Ac」に設定されている必要があります。Split() を使用して、文字列「Ac Ace」から値「Ac」を取得します。

通常、C# ではこれは簡単に実行できますが、CRM 4.0 ではこれをどのように達成できるか ('Ac' を Marque に設定する方法)

ここに画像の説明を入力

public static DependencyProperty modelProperty = DependencyProperty.Register("model",  
typeof(int), typeof(CreateCardetails));
[CrmInput("Model")]
public int model
{
    get
    {
        return (int)base.GetValue(modelProperty);
    }
    set
    {
        base.SetValue(modelProperty, value);
    }
}

public static DependencyProperty ContactProperty =   
DependencyProperty.Register("Contact", typeof(Lookup), typeof(CreateCardetails));

[CrmInput("Contact ID")]
[CrmReferenceTarget("contact")]
public Lookup Contact
{
    get
    {
        return (Lookup)base.GetValue(ContactProperty);
    }
    set
    {

        base.SetValue(ContactProperty, value);
    }
}

protected override ActivityExecutionStatus Execute(ActivityExecutionContext  
executionContext)
{
        //Create an car details record which will be linked to the contact record
        DynamicEntity cardetails = new DynamicEntity("cir_cardetails");

        cardetails["cir_carsdetailsid"] = Contact;

        //Setting the picklist value of Model

         Picklist modelPickList = new Picklist();
         modelPickList.Value = model.Value;
         cardetails.Properties.Add(new PicklistProperty("cir_model",modelPickList));

  /*
      Here the logic should be done for setting Marque (cir_model) value 
         Picklist marquePickList = new Picklist();
         marquePickList.Value = ???
         cardetails.Properties.Add(new PicklistProperty("cir_marque",marquePickList));
  */

       //Creating the car details record
        Guid carkey = crmService.Create(cardetails);
}

Marque値を論理的に設定する方法については、以下のようにコードを空白のままにしています

/*
      Here the logic should be done for setting Marque (cir_marque) value 
         Picklist marquePickList = new Picklist();
         marquePickList.Value = ???
         cardetails.Properties.Add(new PicklistProperty("cir_marque",marquePickList));    
*/

これについて私を助けるよう手配してください。すべての提案を歓迎します。

4

2 に答える 2

1

CRM 4.0 には言語はありません。CRM 4.0 では、C# でコーディングします。唯一の変更点は、新しい型を扱う方法です。

ワークフローでは、コントロールを操作するのではなく、エンティティと関連する属性を操作します。したがって、属性 cir_model を取得し、サブストリングを実行して、Marque で使用可能なオプションを見つけ、修正された値を設定する必要があります。SDK からこのサンプルを確認してください。

于 2013-04-07T08:12:10.627 に答える