0

How could I enable major versioning on list? My code is not working and I don't get any errors.

 _spBodyOnLoadFunctionNames.push(onPageLoad());
    function onPageLoad() {
        ExecuteOrDelayUntilScriptLoaded(enableMajor, 'SP.js')

    }

    function enableMajor() {

        var ctx = new SP.ClientContext.get_current();
        var list = ctx.get_web().get_lists().getByTitle('test');

        ctx.load(list);

        ctx.executeQueryAsync(
            function () {
                list.enableMajor = true;




            },
            function (sender, args) {
                console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
            }
            );
    }
1
  • Is there any specific requirement to enable it using JS? – users1100 Jun 12 '15 at 12:36
1

After you get the list, enable versioning. Then load the list and call execute query async

0

_spBodyOnLoadFunctionNames takes function names.

Therefore:

_spBodyOnLoadFunctionNames.push("onPageLoad");
1
  • its still the same no reaction?, my enableMajor=true; dont get updated? – Batistuta Jun 12 '15 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.