Get the URL of a document from the document library and save the link to a column

I wanted to create a library where user has option only to download the document in SharePoint. They should not able to open the document in Edit or Read-Only mode but they have to download it.

First I created a library and I created 2 columns - one single line text column(Name: Path) and one calculated column(Name: cal).

Create a workflow for that library where we copy the "Encoded URL" with download path into the single line text column. We need to check out and check in the document in the workflow as shown below.



In the above image "then copy from" link is as below with the "Encoded URL".


We are updating the link to a column in the above workflow and check in the document.

Now we create a calculated column use the below formula.


="<a href='"&Path&"'>Click Here to Download the Document</a>"



Now when we look at the library it looks like this.


Find out the page layout template used for a page

If there is a page already created in SharePoint and if you wanted to find the "Page Layout" of that page, then here is the small trick.

Open the site in designer and go to the page. Check out the page and Right click on it, then select "Edit File in Advanced Mode". Noe click on "Edit Page Layout" as shown in the image below.




Then you can see the link of that "Page Layout" and it is going to ask you if you want to check it out.

Show created date and modified date in the editform.aspx page in a list with the fields disabled

Created 2 fields "Created Date" and "Modified Date". Show them only on the EditForm.aspx and DispForm.aspx.

Using designer workflow, create workflow for the list and "Update Item" - Copy Created value to Created Date and Modified value to Modified Date.

Add the following JQuery in the EditPage.aspx using Content Editor Webpart or using designer add the following script under <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">.



<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script>
$(document).ready(function () {
     $('input[title="Created Date"]').attr("disabled","disabled");
    $('input[title="Modified Date"]').attr("disabled","disabled");
});
</script>