![]() |
#1 |
Участник
|
CRM Programmer: Registering plugins for event on many-to-many entities
Источник: http://crmpro.blogspot.com/2009/10/r...t-on-many.html
============== I found that from the box MS CRM 4.0 are not supported the events on many-to-many relationship entities(bridge entities). But Aaron Elder has hack it. All you need is just register it at AssociateEntities or DiassociateEntities event with empty Primary and Secondary Entity fields. -- ============================================================================ -- Enable Associate and Disassociate Plug-in Events Script v1.0 -- ---------------------------------------------------------------------------- -- (c) 2009 Aaron Elder -- ============================================================================ -- DISCLAIMER: -- This script is provided "AS IS" with no warranties, and confers no rights. -- ============================================================================ -- While this is obviously "unsupported", I think the fact that these events -- are not available is a bug and hopefully it will be fixed in a rollup. -- ============================================================================ USE AscentiumCrmDev_MSCRM GO -- Find the deployments SDK Filter ID for the -- Associate and Disassociate Entity SDK Messages DECLARE @DisassociateEntitiesFilterId uniqueidentifier DECLARE @AssociateEntitiesFilterId uniqueidentifier SET @DisassociateEntitiesFilterId = (SELECT SdkMessageId FROM SdkMessageBase WHERE [Name] = 'DisassociateEntities') SET @AssociateEntitiesFilterId = (SELECT SdkMessageId FROM SdkMessageBase WHERE [Name] = 'AssociateEntities') -- Enable the Associate and Disassociate Filters to be valid for custom processing -- Custom Processing means "you register plug-ins against it" -- Note: We only do this for the "generic" (OTC == 0) case, just to be safer UPDATE SdkMessageFilterBase SET IsCustomProcessingStepAllowed = 1 WHERE SdkMessageId = @DisassociateEntitiesFilterId AND PrimaryObjectTypeCode = 0 UPDATE SdkMessageFilterBase SET IsCustomProcessingStepAllowed = 1 WHERE SdkMessageId = @AssociateEntitiesFilterId AND PrimaryObjectTypeCode = 0 (C) http://consulting.ascentium.com/blog/crm/Post533.aspx Источник: http://crmpro.blogspot.com/2009/10/r...t-on-many.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|