WDE Customization | Activate Mark Done Button Programmatically

I need to activate the Mark Done Button in the ToolbarInteractionBarRegion after a given time. For example, if the agent doesn’t click on it in 20 seconds, it must “click itself”.

I already know how to handle the timer elapsed event but I can’t find any solutions for the button activation.

Anyone have any ideas?

Try this (assuming you passed ICommandManager as argument, and assigned to commandManager):


commandManager.GetChainOfCommandByName("InteractionVoiceIfPossibleCloseInteraction").Execute();

Thank you, @hsujdik. It quite seems what I needed but it didn’t really do the trick. When I run the command the interaction related views don’t close the same way as when I push the MarkDone button manually.

I also tried :


commandManager.GetChainOfCommandByName("BundleClose").Execute();

But it didn’t work as well.

So, in case someone is wondering, I was able to come up with a solution for the “click itself” thing. There is a keyboard shortcut for pressing the MarkDone button, it’s CTRL + E.

I found this NuGet package called InputSimulator v1.0.4 by Michael Noonan (https://archive.codeplex.com/?p=inputsimulator). Using it I managed to simulate this shortcut programmatically.

After installing the package, first you need to add these namespaces:


using WindowsInput.Native;
using WindowsInput;

Then, where or when you want to activate the keyboard shortcut you must insert this:


InputSimulator inputSimulator = new InputSimulator();
inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_E);

Nice. Thanks for sharing. As long as it works is good. Just be care to keep that mapping at WDE options

Enviado de meu SM-G9650 usando o Tapatalk

Command chain must be working. you don’t need to use workarounds and simulate click :slight_smile:

I did it like that:
private IInteractionManager ixnManager;

ixnManager = _container.Resolve();

//if you are in interaction view just take current interaction from case
IInteraction ixn = ixnManager.GetInteractionByEntrepriseId(interactionId);

IDictionary<string, object> parameters = new Dictionary<string, object>();
//maybe bundle will be part of case depending from which view are you using
parameters.Add(“CommandParameter”, ixnManager.GetBundleById(ixn.BundleId));

//execute command chain with correct parameters and it will work
container.Resolve().GetChainOfCommandByName(“BundleClose”).Execute(parameters);

Thanks for sharing! This method worked way better. :slight_smile: