PreSaveAction() in NewForm.aspx in SharePoint 2013 list

"text/javascript">
 function PreSaveAction(){
     if(condition){
         return true;
     }
     else{
         alert('Condition not satisfied to save item');
         return false
     }
 }
Reff: https://asknoor.wordpress.com/2013/02/21/usage-of-presaveaction-function-in-newform-aspx-and-editform-aspx-in-sharepoint/
PreSaveAction() in NewForm.aspx in SharePoint 2013 list

How to set customErrors attribute in sharepoint 2013?

Every change you make in that config files have no effect on the web application. You have to go the web.config file that is generated once the web application is created.

So edit the web.config file in C:\inetpub\wwwroot\wss\VirtualDirectories\your port number and modify the parameters you have indicated in that web.config file:

  • customErrors mode must be “Off”
  • compilation debug must be “true”
  • SafeMode CallStack must be “true”

The ‘your port number’ piece of path is the port you assigned when you created the Web Application in the Central Administration

Reff:http://sharepoint.stackexchange.com/questions/73788/how-to-set-customerrors-attribute-in-sharepoint-2013

How to set customErrors attribute in sharepoint 2013?

JSON.parse

The JavaScript function JSON.parse(text) can be used to convert a JSON text into a JavaScript object:

var json = '{"result":true,"count":1}',
    obj = JSON.parse(json);

alert(obj.count);


Reff:http://stackoverflow.com/questions/4935632/parse-json-in-javascript
http://www.w3schools.com/json/json_eval.asp

JSON.parse

User Profile Basic

private static void GetUserProfileProperties(ClientContext contex)
{
var web = contex.Web;
User loginUser = web.CurrentUser;

PeopleManager peoplemanager = new PeopleManager(contex);
PersonProperties personProperits = peoplemanager.GetMyProperties();
contex.Load(personProperits);
contex.ExecuteQuery();

Console.WriteLine(“Account namer” + personProperits.AccountName);
Console.WriteLine(“Email” + personProperits.Email);
Console.WriteLine(“Display Name” + personProperits.DisplayName);
}

Ref:

http://www.vrdmn.com/2015/01/set-user-profile-properties-using-jsom.html

User Profile Basic