Author Topic: WDE Customization Logging Off  (Read 2101 times)

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
WDE Customization Logging Off
« on: July 11, 2019, 12:03:30 PM »
Hello,

I am trying to code WDE so it displays a message when an agent either select Log Off or click the 'X' of the application.
Using code from the samples available, I have implemented the message box I need, however when the agent clicks the 'x', a message box showing "Are you sure you want log off all the channels and exit the application"?" appears first.
If the agents clicks "Log off', the new message appears correctly on its own.
I have a 'BeforeLogoutCommand' class which contains the code and message to display.

In my module class I have added this code.

[i][b]            commandManager.CommandsByName["MediaVoiceLogOff"].Insert(0,
                    new CommandActivator()
                    {
                        CommandType = typeof(BeforeLogoutCommand),
                        Name = "BeforeLogoutCommand"
                    });[/b][/i]

Does another command code need to be added?

thanks,

Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: WDE Customization Logging Off
« Reply #1 on: July 11, 2019, 02:26:15 PM »
Try the Chain of Commands "ApplicationClose" insert before "ChannelsLogOff" command

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
Re: WDE Customization Logging Off
« Reply #2 on: July 11, 2019, 06:12:43 PM »
[quote author=hsujdik link=topic=11386.msg51924#msg51924 date=1562855175]
Try the Chain of Commands "ApplicationClose" insert before "ChannelsLogOff" command
[/quote]

Hello,

Have tried that command but see the same behaviour in that both messages sequentially pop up (original first then new message box).
Furthermore I no longer receive the message box when selecting 'Log Off' from the WDE tool bar.  If I add the original command in addition to the new one, I receive three message boxes when closing the application.
I cant find document which explains which command the original "are you sure you want to log off all channels .." message box relates to - if not the ones used so far.

[i][b]commandManager.InsertCommandToChainOfCommandBefore(
                "ApplicationClose", "ChannelsLogOff",
                new List<CommandActivator>() {
                    new CommandActivator()
                    {
                        CommandType = typeof(BeforeLogoutCommand),
                        Name = "BeforeLogoutCommand"
                    }});[/b][/i]

Also tried the "After" command but same problem.
If I use the original code and replace "VoiceMediaLogOff" with "ApplicationClose", the new message box is received first but then it followed by the original one so same issue just a reverse order.  However as mentioned I no longer receive the message box when selecting 'Log Off' in WDE.

thanks,