Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

am able to create use profile property dynamically but unable to see in user profile properties in sharepoint 2013

$
0
0

Am using following code to create user profile property,am able to run succesfully but i dont know why the property is nt creating in mysite.help me out of this.

Thanx in advance.

function SetUserProperty(accountName, propertyName, propertyValue) {

// this variable contains the XML that is passed to the SOAP web service
//  about which account will have which property modified

var newData = '<?xml version="1.0" encoding="utf-8"?>'+ '<soap:Envelope xmlns:xsi="http://www.w3. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'+ '<soap:Body>'+ ' <ModifyUserPropertyByAccountName
   xmlns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService">'+ '  <accountName>' + accountName + '</accountName>'+ '  <newData>'+ '  <PropertyData>'+ '  <IsPrivacyChanged>false</IsPrivacyChanged>'+ '  <IsValueChanged>true</IsValueChanged>'+ '  <Name>' + propertyName + '</Name>'+ '  <Privacy>Public</Privacy>'+ '  <Values><ValueData><Value xsi:type="xsd:string">'+ propertyValue + '</Value></ValueData></Values>'+ '  </PropertyData>'+ '  </newData>'+ ' </ModifyUserPropertyByAccountName>'+ ' </soap:Body>'+ '</soap:Envelope>'

// this is the actual call to the web service and method responsible
//   for modifying user profile property
$.ajax({
url: '/_vti_bin/UserProfileService.asmx',
beforeSend: function(xhr) {
        xhr.setRequestHeader("SOAPAction","http://microsoft.com/webservices/SharePointPortalServer/
            UserProfileService/ModifyUserPropertyByAccountName");
    },
type: "POST",
dataType: "xml",
data: newData,
complete: displayProfileProperty,
contentType: "text/xml; charset=\"utf-8\""
});
return false;
}


Viewing all articles
Browse latest Browse all 8089

Trending Articles