Add and remove sample data

Note

You can add or remove sample data without writing code. More information: Administrators Guide: Add or remove sample data

You install and uninstall sample data programmatically using the InstallSampleData and UninstallSampleData messages:

Web API Action SDK for .NET Class
InstallSampleData Action InstallSampleDataRequest Class
UninstallSampleData Action UninstallSampleDataRequest Class

Install sample data

Install a pre-defined set of sample data.

Using the InstallSampleDataRequest Class.

static void InstallSampleData(IOrganizationService service)
{
    var request = new InstallSampleDataRequest();
    service.Execute(request);
}

More information:

Note

The InstallSampleDataResponse Class returned by this operation doesn't include any properties to examine.

Uninstall sample data

Remove a pre-defined set of sample data.

Using the UninstallSampleDataRequest Class

static void UninstallSampleData(IOrganizationService service)
{
    var request = new UninstallSampleDataRequest();
    service.Execute(request);
}

More information:

Note

The UninstallSampleDataResponse Class returned by this operation doesn't include any properties to examine.

See Also

Administrators Guide: Add or remove sample data
Import data