What are CCA hosted app adapters?

I am new to Microsoft CRM CCA. I am currently facing some problems. I created a winform and placed it on my agent desktop. The winform is supposed to display the contents of the notepad in the winform text area. How to achieve it? I have no idea as there is not enough documentation on this topic ...... Plz help me here.

+3


source to share


2 answers


If you want to create a hosted app with an adapter then you need to use the AIF(application intregation frame work)

yOU CAN CHECK OUT THE LINK hosted control



and application adapter

+2


source


here you go the complete code

using System;
using Microsoft.Uii.Csr;

namespace Microsoft.Uii.QuickStarts
{
    public partial class QsHostedControl : HostedControl
    {
        public QsHostedControl()
        {
            InitializeComponent();
        }

        // Necessary constructor
        public QsHostedControl(Guid appID, string appName, string initString)
            : base(appID, appName, initString)
        {
            InitializeComponent();
        }

        private void QSHostedControl_Load(object sender, EventArgs e) {}

        // This is the context change event handler.
        public override void NotifyContextChange(Context context)
        {
            // This is the context change handler.

            // Populating text fields from context information.
            txtFirstName.Text = context["CustomerFirstName"];
            txtLastName.Text = context["CustomerLastName"];
            txtAddress.Text = context["Street"];
            txtID.Text = context["CustomerID"];

            // Hands control back over to the base class to notify next app of context change.
            base.NotifyContextChange(context);
        }

        protected override void DoAction(RequestActionEventArgs args)
        {
            //Check the action name to see if it something we know how to handle and perform appropriate work
            switch (args.Action)
            {
                case "UpdateFirstName":
                    txtFirstName.Text = args.Data;
                    break;

                case "UpdateLastName":
                    txtLastName.Text = args.Data;
                    break;                  

            }
        }

        private void updateData_Click(object sender, EventArgs e)
        {
            // This is how you fire an action to other hosted applications. Your DoAction() code
            // in your other application or application adapter will get called via this.
            FireRequestAction(new RequestActionEventArgs("QSExternalApplication", "UpdateFirstName", txtFirstName.Text));
            FireRequestAction(new RequestActionEventArgs("QSExternalApplication", "UpdateLastName", txtLastName.Text));

            FireRequestAction(new RequestActionEventArgs("QSWebApplication", "UpdateFirstName", txtFirstName.Text));
            FireRequestAction(new RequestActionEventArgs("QSWebApplication", "UpdateLastName", txtLastName.Text));
            FireRequestAction(new RequestActionEventArgs("QSWebApplication", "UpdateAddress", txtAddress.Text));
            FireRequestAction(new RequestActionEventArgs("QSWebApplication", "UpdateID", txtID.Text));
        }

        private void btnFireContextChange_Click(object sender, EventArgs e)
        {
            // Get the current context and create a new context object from it.
            string temp = Context.GetContext();
            Context updatedContext = new Context(temp);

            // Update the new context with the changed information.
            updatedContext["CustomerFirstName"] = txtFirstName.Text;
            updatedContext["CustomerLastName"] = txtLastName.Text;

            // Notify everyone of this new context information
            FireChangeContext(new ContextEventArgs(updatedContext));
            // Tell self about this change
            NotifyContextChange(updatedContext);

        }
    }
}

      



you can find it in sdk also

+3


source







All Articles