{"action":"created","issue":{"url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/85","labels_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/85/comments","events_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/85/events","html_url":"https://github.com/MscrmTools/XrmToolBox/issues/85","id":64188304,"number":85,"title":"Start / switch to one plugin from another","user":{"login":"rappen","id":2572253,"avatar_url":"https://avatars.githubusercontent.com/u/2572253?v=3","gravatar_id":"","url":"https://api.github.com/users/rappen","html_url":"https://github.com/rappen","followers_url":"https://api.github.com/users/rappen/followers","following_url":"https://api.github.com/users/rappen/following{/other_user}","gists_url":"https://api.github.com/users/rappen/gists{/gist_id}","starred_url":"https://api.github.com/users/rappen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rappen/subscriptions","organizations_url":"https://api.github.com/users/rappen/orgs","repos_url":"https://api.github.com/users/rappen/repos","events_url":"https://api.github.com/users/rappen/events{/privacy}","received_events_url":"https://api.github.com/users/rappen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-25T06:17:40Z","updated_at":"2015-04-07T20:40:57Z","closed_at":"2015-03-27T17:44:03Z","body":"As we are developing more plugins, where some of them are somewhat related to each other, or could benefit from each other (e.g. _This action needs a fetch to retrieve data, do you want to start FXB to compose the query?_)\r\n\r\nSo it would be great if there was a XTB method to call another plugin, if the plugin is available.\r\n\r\nIt would also be great if it was possible to pass some contextual information to the other plugin.\r\nMight even be possible to pass a \"handle\" to an event listener in the calling plugin, to be able to pass some sort of _result_ back to the caller.\r\n\r\nAs you can hear from my vague request, this needs to be specified in more detail. If it is feasible to implement."},"comment":{"url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/comments/90725909","html_url":"https://github.com/MscrmTools/XrmToolBox/issues/85#issuecomment-90725909","issue_url":"https://api.github.com/repos/MscrmTools/XrmToolBox/issues/85","id":90725909,"user":{"login":"rappen","id":2572253,"avatar_url":"https://avatars.githubusercontent.com/u/2572253?v=3","gravatar_id":"","url":"https://api.github.com/users/rappen","html_url":"https://github.com/rappen","followers_url":"https://api.github.com/users/rappen/followers","following_url":"https://api.github.com/users/rappen/following{/other_user}","gists_url":"https://api.github.com/users/rappen/gists{/gist_id}","starred_url":"https://api.github.com/users/rappen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rappen/subscriptions","organizations_url":"https://api.github.com/users/rappen/orgs","repos_url":"https://api.github.com/users/rappen/repos","events_url":"https://api.github.com/users/rappen/events{/privacy}","received_events_url":"https://api.github.com/users/rappen/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T20:40:57Z","updated_at":"2015-04-07T20:40:57Z","body":"Hi\r\n\r\nJust wanted to let you know that I have implemented this functionality to make my Bulk Data Updater (BDU) able to communicate with FXB. BDU uses fetchxml to retrieve data from CRM, and it is a lot of help to be able to use FXB to compose the fetch.\r\n\r\nCode in BDU:\r\n```\r\n...\r\nvar mbargs = new MessageBusEventArgs(\"FetchXML Builder\");\r\nmbargs.TargetArgument = fetchXml;\r\nOnOutgoingMessage(this, mbargs);\r\n...\r\n\r\npublic void OnIncomingMessage(MessageBusEventArgs message)\r\n{\r\n    if (message.SourcePlugin == \"FetchXML Builder\" &&\r\n        message.TargetArgument != null && message.TargetArgument is string)\r\n    {\r\n        fetchXml = (string)message.TargetArgument;\r\n    }\r\n}\r\n```\r\n\r\nCode in FXB:\r\n```\r\npublic void OnIncomingMessage(MessageBusEventArgs message)\r\n{\r\n    calledArgs = message;\r\n    if (message.TargetArgument != null && message.TargetArgument is string)\r\n    {\r\n        ParseXML((string)message.TargetArgument, false);\r\n    }\r\n    tsbReturnToCaller.ToolTipText = \"Return FetchXML to \" + calledArgs.SourcePlugin;\r\n    EnableControls(true);\r\n}\r\n\r\nprivate void ReturnToCaller()\r\n{\r\n    if (calledArgs == null)\r\n    {\r\n        return;\r\n    }\r\n    var message = new MessageBusEventArgs(calledArgs.SourcePlugin)\r\n    {\r\n        TargetArgument = GetFetchString(true)\r\n    };\r\n    OnOutgoingMessage(this, message);\r\n}\r\n```\r\n\r\nAll this works beautifully!\r\n\r\nSo there is now (when committed etc) a nice and clean integration interface to FetchXML Builder, for anyone to use!"}}