Publish as major version SharePoint file with workflow 2013 REST API


SharePoint 2013 workflows has out of the box workflow actions Check In and Check Out


But does not have any actions for check in as Major version (publish)
To solve this, we can  use the "call http web service" action with SharePoint REST API.

Follow these steps to check in a File as major version (publish):

1. Create a Workflow 2013 in SharePoint Designer

2. Rename the Stage to "Published"
3. Add a Build Dictionary action and name the output variable "JSonRequestHeader". Add a string variable named content-type with the value application/json;odata=verbose and add a new string variable named Accept with the value application/json;odata=verbose and click OK

4. Add a new Build Dictionary action and name the output variable "JSonRequestParameters"
    Add a string variable named comment with the value Published by workflow


5. Check Out the file

6. Add Call http web service action with these properties:

Address
[%Workflow Context:Current Site URL%]/_api/web/getfilebyserverrelativeurl('[%Current Item:Server Relative URL%]')/CheckIn(comment='Published by workflow',checkintype=1)

RequestType: Post

RequestHeaders: Variable: JSonRequestHeader

RequestContent: Variable: JSonRequestParameters

ResponseContent: Variable: JSonResult (Create new)

ResponseHeaders: Variable: JSonResponseHeaders (Create new)

ResponseStatusCode: Variable: responseCode

7. Then publish your workflow

The final result:

Friday, March 06, 2015
Posted by Alon Havivi

PowerShell: Get the Current Configuration Database Version in SharePoint

To get the current SharePoint version start the SharePoint 2013 Management Shell and use the (get-spfarm).buildversion command.

(get-spfarm).buildversion





Monday, February 16, 2015
Posted by Alon Havivi

Universal Apps for Windows 10 phones, pc and tablets

Demo for Word Office, PowerPoint, Messaging, Outlook, Photos, Music, Calendar and Cortana.



Wednesday, January 21, 2015
Posted by Alon Havivi

Project Spartan - New Windows 10 Browser

Three main features...





SharePoint 2013 How to get User Language Preferences with REST API

 
 <script src="/_layouts/15/sp.requestexecutor.js"></script>  
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>  
 <script type="text/javascript">  
   function handler(restURI, s, f) {  
     var restUrl = _spPageContextInfo.webAbsoluteUrl + restURI;  
     var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl);  
     executor.executeAsync(  
       {  
         url: restUrl,  
         method: "GET",  
         headers: { "Accept": "application/json; odata=verbose" },  
         success: s,  
         error: f  
       }  
     );      
   }  
   function success(data) {      
     var jsonObject = JSON.parse(data.body);      
     var results = jsonObject.d.UserProfileProperties.results;       
     for (i = 0; i < results.length; i++) {  
       if (results[i].Key.indexOf("SPS-MUILanguages") > -1) {           
         $('#MUILanguages').append(results[i].Value);  
         break;          
       }  
     }  
   }  
   function fail(data, errorCode, errorMessage) {  
     $('#MUILanguages').append(errorMessage);   
   }  
   $(function () {  
     handler("/_api/SP.UserProfiles.PeopleManager/GetMyProperties", success, fail);  
   });  
 </script>  
 <div id="MUILanguages"> </div>  
Wednesday, January 07, 2015
Posted by Alon Havivi

e-office Slider App for SharePoint

Download and install the App from the Office & SharePoint App Store.

Responsive slider for SharePoint. All browsers support, desktop and mobile devices.
You can resize the slider and/or configure some options:
* List: On the right / On the left / No list
* Change CSS font family
* Open links in new window
* Transition effect: Fading / Sliding
* Auto start: Yes / No
* Slider controls: Yes / No
* Slide interval duration
* Transition duration



Add e-office Slider App Part

Once the e-office slider has been installed, it can be added to a SharePoint Page within any SharePoint Site.

1. Click the Edit Page button on the Page ribbon.
2. Click the Add Web Part link.
3. Select Apps from the Categories list and then select the e-office Slider App Part. 
4. Click the Add button.


Configuration


1. Select Edit Web Part option from the e-office Slider drop down menu. (In Edit Page mode.)
2. The Appearance, Layout and Advanced settings are standard. Adjust the
e-office slider settings or leave the defaults. You can change the size from the Layout section.


Change images

If you can’t locate the e-office Slider List, click View All Site Content, and then click the name of the e-office Slider.


Download and install the App from the Office & SharePoint App Store.


Thursday, December 18, 2014
Posted by Alon Havivi

Popular Post

- Copyright © Alon Havivi's Blog -