CRM 2013 Custom Action Plugin not firing - dynamics-crm-2013

Wondering if someone could give me a bit of help.
I am trying to use custom actions from CRM 2013, what I have is a custom action "Clone" defined as below.
I have a very simple clone record plugin that clones the passed in target entity and returns the new entity as an output parameter.
The plugin is registered to fire on the Custom action, my plan was to fire this from JavaScript but the plugin never fired so for the time being to test I have been firing this from another plugin. Using the below code.
The other plugin fires and hits the call to the execute method but the other plugin never seems to fire and the response is always null.
If anyone has any ideas what I am missing that would be great.
Thanks in advance chaps
Antony

What just get in my mind is that you have to write your OrganizationRequest("name_of_CustomAction") exactly the same way as you have written named your CA ("..._CLONE")
Have you already tried debugging your PLUGIN ? Do that with the Plugin Registration Tool from Microsoft.
If you've already got this tool just try doing it exactly like this(Step-By-Step Guide how to debug your plugin.

Related

what is alternative for AuthActions.LOAD_USER_TOKEN_FAIL in sparatcus v3.x

I am using AuthActions.LOAD_USER_TOKEN_FAIL
action for 2.0 but when I migrate to 3.3.0 I am getting error on this as this has been removed.
can you please let me know what is the alternative for this one if I have to track the HTTP error code like v2.0
thanks in advance.
If you are using the standard "credentials" authentication.
You could extend the OOTB AuthService and overirde the loginWithCredentials, keep the same logic but add some additional logic in the catch which is called if the login failed.
I you don't want to add the logic there directly you could create your own LOAD_USER_TOKEN_FAIL and dispatch it from there. Alternatively, you can use the built in Event mechanism to create a new event an observe it elsewhere in the code.

ActivityFeeds.Plugin.ActivityClose stops record creation, How to solve it?

Some times the ActivityFeeds.Plugin.ActivityClose plugin gets registered on the wrong entity and it stops me from creating new records for that entity.
It usually happens after I register a new plugin with the Plugin Registration Tool.
What is the cause? and how do I solve it?
I haven't found the cause, or how to solve it for good, but to make it work again is simple:
Log into the Plugin Registration Tool.
Select View->Display by Entity(Ctrl+Shift+E).
Expand the entity you are having trouble with.
Expand (message)Create.
Finally select the step for ActivityFeeds.Plugin.ActivityClose and Disable it.
--(Don't Unregister it [in case something breaks])
disable/unregistered the following like steps in plugin ActivityFeeds.Plugins.ActivityClose
ActivityFeeds.Plugins.ActivityClose: Update of any Entity
CAUSE
This kind of steps is registered unintentionally when we do some thing like below in screen shots:
Following is the plugin ActivityFeeds.Plugins.ActivityClose, you can see there is no step registered for this plugin.
Registered an assembly.
Right click on assembly name not on plugin, select registered new step.
Just enter update in message field and then press enter
you can see a step ActivityFeeds.Plugins.ActivityClose: Update of any Entity is added to ActivityFeeds.Plugins.ActivityClose

How to run custom code as part of WiX burn MBA on install-complete and support rollback

I need to embed, invoke and run some custom code as part of my custom managed bootstrapper application, as a post-install step. This custom code is within a class library that I have included as a reference in my MBA project. So, right after the state becomes InstallationState.Applied I plan on invoking this custom code. However, I am unable to figure out how I could tie in a failed state of this custom code to initiate the bootstrapper to rollback, since the progress callback would have been completed by now. Any ideas?
As per WiX & Burn's lead dev Rob Mensching here, point-2, it seems any custom code that needs to facilitate rollback in the setup process should be run as a custom action, and not as part of the bootstrapper application, as I wanted to. I went ahead and did as Rob suggested, and everything works as expected. However, since the custom action runs significant code, I may in future put that in a WiX extension.

Run code when user deletes module from a page

I'm currently developing a DNN module. It would be nice if we were able to run custom code whenever a module is deleted from a page by the user, and also when a module gets restored from recycle bin.
I haven't found any examples on how this could be done, so I'm not sure if this is possible? Any ideas?
I am unaware of any event mechanism inside DNN where you could set your hooks. You could probably debug the DNN code and trace the call stack until you find a usable spot where you can inject some code (which would likely be destroyed after the next DNN update), or maybe detect a way that was intended to be used by the core team.
However, if a module is deleted from a page, the IsDeleted field in the Modules table is set to true. If it gets restored from the bin, it is again set to false.
You can use a TRIGGER in your Sql Server that fires when the Modules table is updated, checks if the update refers to an IsDeleted field, write stuff into a Notification table, and use Sql Query Notification based on SqlDependency to run some code (see http://www.codeproject.com/Articles/144344/Query-Notification-using-SqlDependency-and-SqlCach for an introduction).
Some steps to go, but it should work (and be less exhausting than climbing the Matterhorn :-) ).
There is absolutely hooks in DNN Platform (DotNetNuke) that a developer can attached C# code to.
While there isn't a turn key example that I can provide at the moment, check out the following:
https://github.com/dnnsoftware/Dnn.Platform/blob/c35fdc7fb75db0438f3b872ce4e279e3ea73e7c2/DNN%20Platform/Library/Entities/EventManager.cs
You are looking to hook onto the ModuleRemoved event by the sounds of it.
Here is an example for the user logging in that you could adapt to your event:
Does DNN fire an event when a user logs in?
I hope this helps in the future.

IAT/EAT hooking "gethostbyname"

I wrote this code to hook API functions by changing the address in the IAT and EAT: http://pastebin.com/7d9N1J2c
This works just fine when I want to hook "recv" or "connect". However for some unknown reason when trying to hook "gethostbyname", my hook function is never called.
I tried to find "gethostbyname" in a debugger by taking the base address of the wsock32.dll module + 0x375e, which is what the ordinal 52 of my wsock32.dll is showing as offset. But that just makes me end up in some random asm code, not at the beginning of a function.
The same method however works fine for trying to find the "recv" entry point.
Does anyone see what I might be doing wrong?
I recommend this tool:
http://www.moduleanalyzer.com/
They do exactly the same and show the url that was connected with that API.
The problem is that there are more than one API to translate an url to an address. The application you are hooking may be using another version of the API that you're not intercepting.
Run some disassembler like IDA and attach to your process after you hook this functions, ida get apply changes on attaching and play process and check what is wrong.
In other way you have many libraries to do hooks with trampolines like Microsoft Detours, NCodeHook etc.