UNDOCHECKOUT

Used to undo the check-out of a file in a document library.

Syntax

bool UNDOCHECKOUT(string listName, string file);

Return value

The procedure returns true if operation succeeds, otherwise false.

Example: to undo the check-out of the file named helloworld.txt in document library Shared Documents:

CALL UNDOCHECKOUT('Shared Documents', 'helloworld.txt');

Code examples

Undo check-out

using (var connection = new SharePointConnection(connectionString))
{
    connection.Open();
    using (var command = new SharePointCommand(@"CALL UNDOCHECKOUT('Shared Documents', 'helloworld.txt')", connection))
    {
        var ret = (bool)command.ExecuteScalar();

        if (ret)
            Console.WriteLine("Undo check-out succeeded");
        else
            Console.WriteLine("Undo check-out failed");
    }
}

Code result

Undo check-out succeeded


Skip Navigation Links.

Visa     MasterCard