Allows you to update the properties of a Category.

Namespace: Microsoft.Tag.CampaignManagement
Assembly: Microsoft.Tag.CampaignManagement (in Microsoft.Tag.CampaignManagement.dll) Version: 1.0.7785.0 (1.0.7785.0)

Syntax

C#
bool UpdateCategory(
	UserCredential userCredential,
	string existingCategoryName,
	Category category
)
Visual Basic
Function UpdateCategory ( _
	userCredential As UserCredential, _
	existingCategoryName As String, _
	category As Category _
) As Boolean
Visual C++
bool UpdateCategory(
	UserCredential^ userCredential, 
	String^ existingCategoryName, 
	Category^ category
)

Parameters

userCredential
Type: Microsoft.Tag.CampaignManagement..::..UserCredential
A 64-bit encrypted GUID specifying the user credential.
existingCategoryName
Type: System..::..String
The current category name.
category
Type: Microsoft.Tag.CampaignManagement..::..Category
A Category object containing the new category information.

Return Value

true if the function succeeds.

false if the function fails.

Remarks

UpdateCategory allows you to edit and change an existing Category name, start date, and end date. The new Category object's Name and UTCStartDate parameters must be set or the method will fail. If the end date is not set, the updated category will not expire.

If you wish to keep the category name or the start or end date the same, set that parameter equal to the current value.

UpdateCategory fails when the new Category name duplicates an existing category name.

Examples

This code sample demonstrates how to call UpdateCategory(UserCredential, String, Category).
CopyC#
private void LocalUpdateCategory()
{
    try
    {
        Category oCat = new Category();
        MIBPContractClient OMIBPClient = new MIBPContractClient();
        UserCredential oCredential = new UserCredential();

        oCredential.AccessToken = "Enter your access token";
        oCat.Name = "New Category Name";
        oCat.UTCEndDate = new DateTime(yyyy, mm, dd);
        oCat.UTCStartDate = new DateTime(yyyy, mm, dd);

        OMIBPClient.UpdateCategory(oCredential, "Category Name", oCat);
    }
    catch
    {
        throw;
    }
}

See Also