Kpi.CreateNew Method
Creates a key performance indicator (KPI) that is initialized with a random GUID.
Namespace: Microsoft.PerformancePoint.Scorecards
Assembly: Microsoft.PerformancePoint.Scorecards.Client (in Microsoft.PerformancePoint.Scorecards.Client.dll)
Syntax
'Declaration
Public Shared Function CreateNew As Kpi
'Usage
Dim returnValue As Kpi
returnValue = Kpi.CreateNew()
public static Kpi CreateNew()
Return Value
Type: Microsoft.PerformancePoint.Scorecards.Kpi
A new KPI that is initialized with a random GUID.
Remarks
Use this method to create KPIs instead of using the constructor.
Examples
The following code example shows how to create a KPI.
Before you can compile this code example, you must do the following:
Configure your development environment and create a C# class library project in Visual Studio. For information about configuring a development environment, see Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008.
Add the Microsoft.PerformancePoint.Scorecards.Client DLL as a reference to your project. For more information about PerformancePoint Services in Microsoft SharePoint Server 2010 DLLs, see PerformancePoint Services DLLs Used in Development Scenarios.
Add a using directive to the Microsoft.PerformancePoint.Scorecards namespace.
Create a method (private void TestMethod()), and paste the following code example into the new method.
Kpi kpi = Kpi.CreateNew();
kpi.CreatedDate = DateTime.Now;
kpi.Name.Text = "KPI name";
kpi.Location = new RepositoryLocation("/BI Center/Lists/PerformancePoint Content", 2);
// TODO: Add error handling, validation checks, and return the new KPI object.