WaelHamze / dyn365-ce-vsts-tasks

VSTS Extension for Dynamics 365 Customer Engagement
https://marketplace.visualstudio.com/items?itemName=WaelHamze.xrm-ci-framework-build-tasks
GNU General Public License v3.0
117 stars 56 forks source link

MSCRM Plugin Registration on custom action fails #48

Closed stigdefeyter closed 5 years ago

stigdefeyter commented 5 years ago

I'm using the MSCRM Plugin Registration task, but when trying to register a plugin on an (unbound) action, the following error occurs "sdkmessagefilter With Id = 00000000-0000-0000-0000-000000000000 Does Not Exist". I have checked if the messagename is available by querying the sdkmessages (https://mycrm/api/data/v9.0/sdkmessages?$filter=name%20eq%20%27**vuz_GenerateBuildingPhases**%27), and that is the case. Is there any property missing in the configuration (PluginRegistrationMapping.json) ?

PluginRegistrationMapping.json { "Name": "MyProject.Plugins.dll", "IsolationMode": "Sandbox", "SourceType": "Database", "PluginTypes": [ { "Description": null, "Name": "MyProject.Plugins.GenerateBuildingPhases", "FriendlyName": "70537E41-447E-4803-A484-97643D348F18", "TypeName": "MyProject.Plugins.GenerateBuildingPhases", "Steps": [ { "Name": "MyProject.Plugins.GenerateBuildingPhases: Action vuz_GenerateBuildingPhases", "MessageName": "vuz_GenerateBuildingPhases", "Description": "MyProject.Plugins.GenerateBuildingPhases: Action vuz_GenerateBuildingPhases", "CustomConfiguration": null, "FilteringAttributes": null, "ImpersonatingUserFullname": null, "Mode": "Synchronous", "PrimaryEntityName": null, "Rank": 1, "Stage": "Postoperation", "SupportedDeployment": "ServerOnly", "Images": [] } ] } ] }

Output of the query "https://mycrm/api/data/v9.0/sdkmessages?$filter=name%20eq%20%27vuz_GenerateBuildingPhases%27"

{"@odata.context":"https://mycrm/api/data/v9.0/$metadata#sdkmessages","value":[{"@odata.etag":"W/\"1445485\"","isprivate":false,"isreadonly":false,"customizationlevel":1,"categoryname":"CustomOperation","createdon":"2019-02-13T07:17:45Z","autotransact":true,"sdkmessageid":"58d80174-5f2f-e911-a834-000d3a45a2ae","name":"vuz_GenerateBuildingPhases","template":false,"availability":0,"solutionid":"fd140aae-4df4-11dd-bd17-0019b9312238","ismanaged":false,"versionnumber":1445485,"sdkmessageidunique":"9b25ec65-c8de-475e-8ce9-8baa34ce5986","introducedversion":"1.0.0.0","_modifiedby_value":"6cd714c7-0426-e911-a82c-000d3a2fe6cc","workflowsdkstepenabled":true,"modifiedon":"2019-02-13T07:24:33Z","componentstate":0,"_createdby_value":"6cd714c7-0426-e911-a82c-000d3a2fe6cc","_organizationid_value":"510d7199-81cf-4c7d-86a0-582ef1d596d9","overwritetime":"1900-01-01T00:00:00Z","expand":false,"isactive":true,"isvalidforexecuteasync":null,"_modifiedonbehalfby_value":null,"throttlesettings":null,"_createdonbehalfby_value":null}]}

WaelHamze commented 5 years ago

@stigdefeyter can you replicate this issue using latest version that was published a couple of days ago?

stigdefeyter commented 5 years ago

@WaelHamze , I have tested it with the latest version (11.*), but it does not yet succeed. The errormessage now is "SdkMessageId is empty guid!". FYI, I have added an Id in the step configuration to make sure there is one.

Below is the step configuration of the plugintype

"Steps": [ { "Id": "d42ec310-8e36-e911-a83c-000d3a45a2ae", "Name": "MyProject.Plugins.GenerateProjectBuildingPhases: Action vuz_GenerateProjectBuildingPhases", "MessageName": "vuz_GenerateBuildingPhases", "Description": "MyProject.Plugins.GenerateProjectBuildingPhases: Action vuz_GenerateProjectBuildingPhases", "CustomConfiguration": null, "FilteringAttributes": null, "ImpersonatingUserFullname": null, "Mode": "Synchronous", "PrimaryEntityName": null, "Rank": 1, "Stage": "Postoperation", "SupportedDeployment": "ServerOnly", "AsyncAutoDelete": false, "StateCode": "Enabled", "Images": [] }

FYI : Registering a plugin step on a standard message / entity (e.g. Create) works fine.

WaelHamze commented 5 years ago

@stigdefeyter should be fixed, pls give it a try with the latest nuget and extension.

stigdefeyter commented 5 years ago

@WaelHamze , works great now, thanks for your help.

WaelHamze commented 5 years ago

@stigdefeyter excellent. Glad to hear. Apologies it took a while to get this fixed.