locked
undocheck out page using JavaScript RRS feed

  • Question

  • hi friends

    i am need to undocheck out of page using JavaScript.

    my scenario is

    1. i have RequestList(custom list) it will have requests to edit page(page id, user name) 

    2. if user try to edit page on edit mode it has to check whether request is there on request list or not. 

    3. if there is no request from edit mode it has to undo-checkout and come back to display mode using JavaScript.

            var url1=_spPageContextInfo.serverRequestPath;	
    	var context = SP.ClientContext.get_current();
    	var web = context.get_web();
    	var file = web.getFileByServerRelativeUrl(url1);
    	context.load(file);
            file.undoCheckOut();	
    

    the above code am using but it is not working 

    Monday, June 30, 2014 6:24 AM