Author Topic: How to attach data in Email and Chat interactions Workspace Desktop Edition  (Read 2601 times)

Offline marckoguzman

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Hello, I´m tried to attach data to Email and Chat interactions when interaction doesn´t come with attached data en Case part with simple code:

                    object caseObject;
                    if (contextDictionary.TryGetValue("Case", out caseObject))
                    {
                     
                        ICase caseInx = caseObject as ICase;
                      caseInx.MainInteraction.SetAttachedData("LastName", LN);

But doesn´t work. There is any way to send this information like part of data interaction. In interaction voice is working  different:

voiceService.SetAttachedData(caseInx.MainInteraction.EntrepriseInteractionCurrent, "NumPerson", nump);

This code work fine to voice interactions


Thanks for your help!!!

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
In which command do you try to get the interaction object?

Offline marckoguzman

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
I´m not using this sentence inside command, I´m trying execute inside Extended View button click event, when I get data from external web service.

public partial class MySampleView : UserControl, IMySampleView
    {
      //here container definition
        readonly IObjectContainer container;
      string ape="S/N";
    ...


private void GetData_Click(object sender, RoutedEventArgs e)
        {
        IAgent myAgent = container.Resolve<IAgent>();
        IEnterpriseServiceProvider enterpriseService = myAgent.EntrepriseService;
        IDictionary<string, object> contextDictionary = (Context as IDictionary<string, object>);
                    //IMediaVoice
                    IVoiceService voiceService = enterpriseService.Resolve<IVoiceService>("voiceService");
                    IChatService chatService = enterpriseService.Resolve<IChatService>("chatService");
                    IEmailService emailService = enterpriseService.Resolve<IEmailService>("emailService");
                    object caseObject;
                    if (contextDictionary.TryGetValue("Case", out caseObject))
                    {

                        ICase caseInx = caseObject as ICase;

                        var tipo = caseInx.MainInteraction.Type;

                    if (Dat.ape.ToString() != null)
                    {
                     
                        ape = Dat.ape.ToString();
                    }

                        if (tipo.ToString() == "InteractionEmail" || tipo.ToString() == "InteractionInboundEmail")
                        {

                            caseInx.MainInteraction.SetAttachedData("LastName", ape);
                          }
        }

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Use InteractionManager interface to get an interaction object on which you can set the attached data