Genesys CTI User Forum > Genesys-related Development

How do you get interaction user data? WDE customization

(1/1)

PFCCWA:
Hello,

I am trying to find the method to get a userdata key value from the interaction so it can be used to start a browser.
this is what I tried so far.
At the event ringing , WDE extracts the value of key ('URL_Field') and starts a browser ('http://www.genesys.com).
I have added a messagebox to confirm the value is extracted but that brings a blank response when call lands in WDE.
Tried a few other code snippets without success so not sure whether I am using an invalid method.
essentially I just want to take the key value and use it to start a browser in a new window.

[i][b]//…...
case EventRinging.MessageId:
                        // Do your processing here
                        var Url = string.Empty;

                        KeyValueCollection attachedData = interaction.AttachedDataInformation;
                        if (attachedData.ContainsKey("URL_Field"))
                            Url = attachedData["URL_Field"].ToString();

                        IWMessageBoxView.Show("Interaction Created: " + Url, IWMessageBoxButtons.Ok, MessageBoxIcon.Information);

                        System.Diagnostics.Process.Start(Url);
//…..[/b][/i]


thanks

PeteHoyle:
Try this:

            [code]
            if (interaction.GetAllAttachedData().ContainsKey("URL_Field"))
            {
                return interaction.GetAllAttachedData()["URL_Field"] as string;
            }[/code]

jamesmurphyau:
GetAllAttachedData() is definitely the way to go

PFCCWA:
[quote author=PeteHoyle link=topic=11389.msg51938#msg51938 date=1563266537]
Try this:

            [code]
            if (interaction.GetAllAttachedData().ContainsKey("URL_Field"))
            {
                return interaction.GetAllAttachedData()["URL_Field"] as string;
            }[/code]
[/quote]


thank you , worked like a treat.
This is the full portion of the code I used in the end after the EventRinging..

[i][b]//…...
{
                    case EventRinging.MessageId:
                        // Do your processing here
                        var Url = string.Empty;

                        KeyValueCollection attachedData = interaction.AttachedDataInformation;
                        if (interaction.GetAllAttachedData().ContainsKey("URL_Field"))
                        Url = interaction.GetAllAttachedData()["URL_Field"] as string;

                        IWMessageBoxView.Show("Interaction Created: " + Url, IWMessageBoxButtons.Ok, MessageBoxIcon.Information);

                        System.Diagnostics.Process.Start(Url);

                        break;
//….[/b][/i]

Navigation

[0] Message Index

Go to full version