Creating Custom Views

Good Morning Experts,

I'm having an issue creating custom views for my custom class. I exported the MP the incident class views are stored in (ServiceManager.IncidentManagement.Configuration.XML) and tried to mimic the code, but I seem to be having issues.

I have an RMA class, but I only have one view for it. Basically when a user clicks on my RMA view it shows ALL RMA tickets created. I need some separate sub-views within RMA the way there are sub-views on the other OOB classes. The first one I tried copying was the "Active Tickets" view (show only tickets that do not have status set to "Resolved" or "Closed").

I added a category as follows:

<Category ID="Category.RMA.Subviews.OpenStatusView.Category" Target="RMA.Subviews.OpenStatusView" Value="Console!Microsoft.EnterpriseManagement.ServiceManager.UI.Console.ViewTasks" />

The view is defined as follows:

<View ID="RMA.Subviews.OpenStatusView" Accessibility="Public" Enabled="true" Target="COMPANY.RMA.Class" TypeID="SMConsole!GridViewType" Visible="true">
	   <Category>NotUsed</Category>
        <Data>
          <Adapters>
            <Adapter AdapterName="dataportal:EnterpriseManagementObjectAdapter">
              <AdapterAssembly>Microsoft.EnterpriseManagement.UI.SdkDataAccess</AdapterAssembly>
              <AdapterType>Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.EnterpriseManagementObjectAdapter</AdapterType>
            </Adapter>
            <Adapter AdapterName="viewframework://Adapters/AdvancedList">
              <AdapterAssembly>Microsoft.EnterpriseManagement.UI.ViewFramework</AdapterAssembly>
              <AdapterType>Microsoft.EnterpriseManagement.UI.ViewFramework.AdvancedListSupportAdapter</AdapterType>
            </Adapter>
            <Adapter AdapterName="omsdk://Adapters/Criteria">
              <AdapterAssembly>Microsoft.EnterpriseManagement.UI.SdkDataAccess</AdapterAssembly>
              <AdapterType>Microsoft.EnterpriseManagement.UI.SdkDataAccess.DataAdapters.SdkCriteriaAdapter</AdapterType>
            </Adapter>
          </Adapters>
          <ItemsSource>
            <AdvancedListSupportClass DataTypeName="" AdapterName="viewframework://Adapters/AdvancedList" FullUpdateAdapter="dataportal:EnterpriseManagementObjectAdapter" DataSource="mom:ManagementGroup" FullUpdateFrequency="1" Streaming="true" IsRecurring="true" RecurrenceFrequency="{x:Static s:Int32.MaxValue}" xmlns="clr-namespace:Microsoft.EnterpriseManagement.UI.ViewFramework;assembly=Microsoft.EnterpriseManagement.UI.ViewFramework" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib">
              <AdvancedListSupportClass.Parameters>
                <QueryParameter Parameter="TypeProjectionId" Value="$MPElement[Name='COMPANY.RMA.Class.Projection']$" />
              </AdvancedListSupportClass.Parameters>
            </AdvancedListSupportClass>
          </ItemsSource>
          <Criteria>
		    <QueryCriteria Adapter="omsdk://Adapters/Criteria" xmlns="http://tempuri.org/Criteria.xsd">
              <Criteria>
                <FreeformCriteria>
                  <Freeform>
                    <Criteria xmlns="http://Microsoft.EnterpriseManagement.Core.Criteria/">
                      <Expression>
                        <And>
                          <Expression>
                            <SimpleExpression>
                              <ValueExpressionLeft>
                                <Property>$Context/Property[Type='COMPANY.RMA.Class']/Status$</Property>
                              </ValueExpressionLeft>
                              <Operator>NotEqual</Operator>
                              <ValueExpressionRight>
                                <Value>$MPElement[Name="WorkItem!IncidentStatusEnum.Resolved"]$</Value>
                              </ValueExpressionRight>
                            </SimpleExpression>
                          </Expression>
                          <Expression>
                            <SimpleExpression>
                              <ValueExpressionLeft>
                                <Property>$Context/Property[Type='COMPANY.RMA.Class']/Status$</Property>
                              </ValueExpressionLeft>
                              <Operator>NotEqual</Operator>
                              <ValueExpressionRight>
                                <Value>$MPElement[Name="WorkItem!IncidentStatusEnum.Closed"]$</Value>
                              </ValueExpressionRight>
                            </SimpleExpression>
                          </Expression>
                        </And>
                      </Expression>
                    </Criteria>
                  </Freeform>
                </FreeformCriteria>
              </Criteria>
            </QueryCriteria>
          </Criteria>
        </Data>
		<Presentation>
          <Columns>
            <mux:ColumnCollection xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mux="http://schemas.microsoft.com/SystemCenter/Common/UI/Views/GridView" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:datebinding="clr-namespace:Microsoft.EnterpriseManagement.UI.Extensions;assembly=Microsoft.EnterpriseManagement.UI.Extensions" xmlns:data="clr-namespace:Microsoft.EnterpriseManagement.UI.Extensions;assembly=Microsoft.EnterpriseManagement.UI.Extensions" xmlns:appCommon="clr-namespace:Microsoft.EnterpriseManagement.ServiceManager.Application.Common;assembly=Microsoft.EnterpriseManagement.ServiceManager.Application.Common" xmlns:toolbox="clr-namespace:Microsoft.EnterpriseManagement.UI.WpfToolbox;assembly=Microsoft.EnterpriseManagement.UI.FormsInfra" xmlns:slaBinding="clr-namespace:Microsoft.EnterpriseManagement.ServiceManager.SLA.Common;assembly=Microsoft.EnterpriseManagement.ServiceManager.SLA.Common">
              <mux:Column Name="DisplayName" DisplayMemberBinding="{Binding Path=DisplayName, Mode=OneWay}" Width="100" DisplayName="DisplayName.b5b3fbef168d40d785d95907d6b0944a" Property="DisplayName" DataType="s:String" />
              <mux:Column Name="Description" DisplayMemberBinding="{Binding Path=Description, Mode=OneWay}" Width="100" DisplayName="Description.9b1cd4850abe4bbeaa4446a29f9fa3dc" Property="Description" DataType="s:String" />
              <mux:Column Name="Backend_Case" DisplayMemberBinding="{Binding Path=Backend_Case, Mode=OneWay}" Width="100" DisplayName="Backend Case" Property="Backend_Case" DataType="s:Boolean" />
              <mux:Column Name="Old_Part_Num" DisplayMemberBinding="{Binding Path=Old_Part_Num, Mode=OneWay}" Width="100" DisplayName="Old Part #" Property="Old_Part_Num" DataType="s:String" />
              <mux:Column Name="Old_Serial_Num" DisplayMemberBinding="{Binding Path=Old_Serial_Num, Mode=OneWay}" Width="100" DisplayName="Old Serial #" Property="Old_Serial_Num" DataType="s:String" />
              <mux:Column Name="Vendor_RMA_Num" DisplayMemberBinding="{Binding Path=Vendor_RMA_Num, Mode=OneWay}" Width="100" DisplayName="Vendor RMA #" Property="Vendor_RMA_Num" DataType="s:String" />
              <mux:Column Name="Source" DisplayMemberBinding="{Binding Path=Source.DisplayName, Mode=OneWay}" Width="100" DisplayName="Source List" Property="Source.DisplayName" DataType="s:String" />
              <mux:Column Name="New_Serial_Num" DisplayMemberBinding="{Binding Path=New_Serial_Num, Mode=OneWay}" Width="100" DisplayName="New Serial Number" Property="New_Serial_Num" DataType="s:String" />
              <mux:Column Name="StartDate" DisplayMemberBinding="{Binding Path=StartDate, Mode=OneWay}" Width="150" DisplayName="RMA Start Date" Property="StartDate" DataType="s:DateTime" />
              <mux:Column Name="sDisplayName" DisplayMemberBinding="{Binding Path=Status.DisplayName, Mode=OneWay}" Width="100" DisplayName="Status" Property="Status.DisplayName" DataType="s:String" />
              <mux:Column Name="Customer_List.DisplayName" DisplayMemberBinding="{Binding Path=Customer_List.DisplayName, Mode=OneWay}" Width="100" DisplayName="Customer" Property="Customer_List.DisplayName" DataType="s:String" />
              <mux:Column Name="Destination_FSL_List" DisplayMemberBinding="{Binding Path=Target_FSL.DisplayName, Mode=OneWay}" Width="100" DisplayName="Destination FSL" Property="Target_FSL.DisplayName" DataType="s:String" />
            </mux:ColumnCollection>
          </Columns>
          <AdditonalProperties />
		  <ViewStrings>
            <ViewString ID="Description.9b1cd4850abe4bbeaa4446a29f9fa3dc">$MPElement[Name="Description.9b1cd4850abe4bbeaa4446a29f9fa3dc"]$</ViewString>
            <ViewString ID="DisplayName.b5b3fbef168d40d785d95907d6b0944a">$MPElement[Name="DisplayName.b5b3fbef168d40d785d95907d6b0944a"]$</ViewString>
          </ViewStrings>
		</Presentation>


I also added a FolderItem (not sure if this is needed):

	  <FolderItem ElementID="RMA.Subviews.OpenStatusView" ID="FolderItem.OpenStatusView" Folder="WorkItem1!ServiceManager.Console.WorkItem.Root" />  

An image reference, and the appropriate DisplayString...

What have I done wrong / missing?

Thanks in advance!

April 28th, 2015 11:13am

You have created a new RMA class with it's own properties it seems?

So the new RMA class has it's own Status enum list ('COMPANY.RMA.Class']/Status$)?

But in the Criteria you are using the enum property of the "WorkItem!IncidentStatusEnum.Resolved" and "WorkItem!IncidentStatusEnum.Closed".

Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 12:26pm

Although I did create my own properties, my RMA class is using base class "WorkItem" so I am using the WorkItem Status (same status list that shows up in incidents). I kept changing things around because they were not working. So it was originally set to

"'WorkItem!System.WorkItem.Incident']/Status$"

Should I keep it that way then?

April 28th, 2015 12:34pm

I doubt that the System.WorkItem base class has a Status enumeration.

The Status enum of the Incident class is defined in the System.WorkItem.Incident class.

If your RMA class is usig System.WorkItem as the base class as far as I know the Status enumeration can't be from the Syste.WirkItem.Incident class.

How did you create the new RMA class?

Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 12:59pm

Its just an alias (probably should be called CoreIncident in retrospect). WorkItem! is the alias I used for System.WorkItem.Incident.Library

I created the class through the Authoring Tool

April 28th, 2015 1:01pm

Try to avoid "Not Equal to" in Your criteria. Use only "Equal to" and see if that helps.
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 4:31pm

Isn't the "Not Equal" operator stating it wants to filter tickets that are not equal to resolved and not equal to closed?
April 28th, 2015 4:50pm

I have a feeling the issue is one of the following (or a mixture of a few of these):

  1. My category is entered incorrectly, or missing a second category
  2. I am missing a string resource?
  3. I am targeting the wrong ID in my criteria
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 4:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics