แก้ไข

แชร์ผ่าน


Walkthrough 5: Display enhanced session information by displaying session name and overview data

In the previous walkthrough, Walkthrough 4: Display a record in a session in your agent application, you learned how to display your customer record stored in a session in Unified Service Desk. However, the experience would be better if you can identify each session with a unique name along with some key overview information about the record in a session.

This walkthrough demonstrates how to dynamically display session name and session overview information to enhance the customer-interaction experience for your agents. This walkthrough is built on top of the previous walkthrough, Walkthrough 4: Display a record in a session in your agent application.

Prerequisites

In This Walkthrough

Step 1: Create a Session Lines type of hosted control to display session overview information

Step 2: Define session name information

Step 3: Define session overview information

Step 4: Add the controls to the configuration

Step 5: Test the application

Conclusion

Step 1: Create a Session Lines type of hosted control to display session overview information

To display session overview information in your agent application, create an instance of a Session Lines type of hosted control in your agent application.

  1. Sign in to the Dynamics 365 instance.

  2. Go to Settings > Unified Service Desk.

  3. Click Hosted Controls.

  4. Click New.

  5. On the New Hosted Control page, specify the following values:

    Field Value
    Name Contoso Session Overview
    USD Component Type Session Lines
    Display Group SessionExplorerPanel

    Create a Session Lines hosted control.

  6. Click Save.

Step 2: Define session name information

To dynamically display the session tab name, you’ll configure a session lines rule using the replacement parameters.

  1. Sign in to the Dynamics 365 instance.

  2. Go to Settings > Unified Service Desk.

  3. Click Session Lines.

  4. Click New.

  5. On the New Session Information page, specify the following values:

    Field Value
    Order Any random value; say 5
    Name Contoso Session Name
    Selected Entity account
    Type Session Name
    Display Session: [[account.name]]

    We are using the replacement parameters to define the session tab name format. In this case the session name will be Session: followed by the name of the account record that is displayed in the session.

    Define session tab name text and format.

  6. Click Save.

Step 3: Define session overview information

Define the session overview information to display in the Session Lines type of hosted control that you configured in step 1.

  1. Sign in to the Dynamics 365 instance.

  2. Go to Settings > Unified Service Desk.

  3. Click Session Lines.

  4. Click New.

  5. On the New Session Information page, specify the following values.

    • Order: Any random value; say 6.

    • Name: Contoso Session Overview Info

    • Selected Entity: account

    • Type: Session Overview

    • Display:

      <Grid Margin="0"      xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"      xmlns:CCA="clr-namespace:Microsoft.Crm.UnifiedServiceDesk.Dynamics;assembly=Microsoft.Crm.UnifiedServiceDesk.Dynamics">  
        <Grid.RowDefinitions>  
          <RowDefinition Height="auto" />  
          <RowDefinition Height="auto" />  
          <RowDefinition Height="auto" />  
          <RowDefinition Height="auto" />  
          <RowDefinition Height="auto" />  
          <RowDefinition Height="auto" />  
        </Grid.RowDefinitions>  
        <Grid.ColumnDefinitions>  
          <ColumnDefinition Width="80"/>  
          <ColumnDefinition Width="*" />  
          <ColumnDefinition Width="auto" />  
        </Grid.ColumnDefinitions>  
        <TextBlock Margin="5,0,0,0" Grid.Row="0" TextWrapping="Wrap" Padding="3,0,0,3" Grid.ColumnSpan="3" FontFamily="Tohoma" FontSize="14" Style="{DynamicResource AutoCollapse}" Text="Primary Contact: [[account.primarycontactid.name]x]" />  
        <TextBlock Margin="5,0,0,0" Grid.Row="1" TextWrapping="Wrap" Padding="3,0,0,3" Grid.ColumnSpan="3" FontFamily="Tohoma" FontSize="14" Text="[[account.address1_line1]x]"/>  
        <TextBlock Margin="5,0,0,0" Grid.Row="2" TextWrapping="Wrap" Padding="3,0,0,3" Grid.ColumnSpan="3" FontFamily="Tohoma" FontSize="14" Style="{DynamicResource AutoCollapse}" Text="[[account.address1_line2]+x]" />  
        <TextBlock Margin="5,0,0,0" Grid.Row="3" TextWrapping="Wrap" Padding="3,0,0,3" Grid.ColumnSpan="3" FontFamily="Tohoma" FontSize="14" Style="{DynamicResource AutoCollapse}" Text="[[account.address1_line3]+x]" />  
        <TextBlock Margin="5,0,0,0" Grid.Row="4" TextWrapping="Wrap" Padding="3,0,0,3" Grid.ColumnSpan="3" FontFamily="Tohoma" FontSize="14" Style="{DynamicResource AutoCollapse}" Text="[[account.address1_city]x], [[account.address1_stateorprovince]x] [[account.address1_postalcode]x]" />  
        <TextBlock Margin="5,0,0,0" Grid.Row="5" TextWrapping="Wrap" Padding="3,0,0,3" Grid.ColumnSpan="3" FontFamily="Tohoma" FontSize="14" Style="{DynamicResource AutoCollapse}" Text="Phone: [[account.telephone1]x]" />  
      </Grid>  
      

      Note

      This sample uses XAML and replacement parameters to define the session overview information that displays the current account’s primary contact, address, and phone number in the session overview area.

    Define session overview information.

  6. Click Save.

Step 4: Add the controls to the configuration

In this step, you’ll add the hosted control and session line rules that were configured in this walkthrough to Contoso Configuration to display these controls to the user who is assigned to the configuration. Contoso Configuration was created in Walkthrough 1: Build a simple agent application.

Add the following to Contoso Configuration.

Control name Control type
Contoso Session Overview Hosted Control
Contoso Session Name Session Line
Contoso Session Overview Info Session Line

To add a control to the configuration:

  1. Sign in to the Dynamics 365 instance.

  2. Go to Settings > Unified Service Desk.

  3. Click Configuration.

  4. Click Contoso Configuration to open the definition.

  5. On the nav bar, click the down arrow next to Contoso Configuration, and select Hosted Controls.

  6. On the next page, click Add Existing Hosted Control, type “Contoso Session Overview” in the search bar, and then press ENTER or click the search icon.

  7. In the search result box, click the hosted control to add it to Contoso Configuration.

  8. Similarly, add the session line controls by clicking the down arrow next to Contoso Configuration, and clicking Session Lines.

  9. Click Save.

Step 5: Test the application

  1. Start the Unified Service Desk client application, and sign in to the Dynamics 365 instance where you configured Unified Service Desk by using the same user credentials that is assigned to Contoso Configuration in Walkthrough 1: Build a simple agent application. For information about connecting to Dataverse instance using the Unified Service Desk client application, see Connect to a model-driven app instance using the Unified Service Desk client

  2. Click the down arrow next to the Search button in the toolbar, and then click Account to display the account records from your Dataverse instance.

  3. Click the expander to display the left pane (SessionExplorerPanel).

    Choose the expander in Unified Service Desk.

  4. Click any of the account records to display the respective account information in a session in the agent application. Note that the name of the session tab automatically displays the word Session: followed by the current account name. The left pane displays the session overview information that was defined earlier.

    Session name and overview information.

  5. If you open another account record, it will be displayed in another session in your client application. To open another account, click the down arrow next to the Search button, click Account, and then click an account name to display the account information in another session.

    Multiple sessions in Unified Service Desk.

Conclusion

In this walkthrough, you saw how to use the session lines configuration rules to contextually display the session tab name and key overview information about the record in a session in your agent application. You also learned how to filter access to Unified Service Desk controls using configuration.

See also

Walkthrough 1: Build a simple agent application

Walkthrough 2: Display an external webpage in your agent application

Walkthrough 3: Display records in your agent application

Walkthrough 4: Display a record in a session in your agent application

Walkthrough 6: Configure the Debugger hosted control in your agent application

Walkthrough 7: Configure agent scripting in your agent application

Unified Service Desk Configuration Walkthroughs