4

請求書と請求書の詳細という 2 つのシステム エンティティがあります。

システムには関連付け 1:N - 請求書詳細 (親: 請求書、子: 請求書詳細) が存在します。

請求書の詳細に移動し、次に製品セクション (invoicedetail) に移動して、新しい製品を追加します。現在、この製品と請求書は関連付けられていますが、私のプラグインはトリガーされていません;/

アソシエイトにプラグインを登録しました (プラグイン登録ツールでは親エンティティと子エンティティは空で、実行は POST-Operation です)。

コード:

if(context.Message == "Associate")
{
    //but plugin not go here - it's not trigger on associate ;/
    if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is EntityReference)
    {
        entityRef = (EntityReference)context.InputParameters["Target"];
        entity = service.Retrieve("invoice", entityRef.Id, new Microsoft.Xrm.Sdk.Query.ColumnSet("invoiceid", "numberOfSomething"));
    }
    else
    {
        throw new Exception("excep");
    }
}
4

1 に答える 1