Skip to main content
EDIT
Source Link
Gaurravs
  • 3.6k
  • 12
  • 23
  • 33

Environment : SP 2010

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
              fieldName: "CompanyCode"
           });
        alert(companyCode);

Let me know how can I achieve this?

Edit: Now I have taken SP.Profile.js file from 2013 environment and referenced it. Still facing issue.

Environment : SP 2010

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
              fieldName: "CompanyCode"
           });
        alert(companyCode);

Let me know how can I achieve this?

Environment : SP 2010

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
              fieldName: "CompanyCode"
           });
        alert(companyCode);

Let me know how can I achieve this?

Edit: Now I have taken SP.Profile.js file from 2013 environment and referenced it. Still facing issue.

added 53 characters in body
Source Link
Gaurravs
  • 3.6k
  • 12
  • 23
  • 33

Environment : SP 2010

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
              fieldName: "CompanyCode"
           });
        alert(companyCode);

Let me know hothow can I achieve this?

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
          fieldName: "CompanyCode"
       });
    alert(companyCode);

Let me know hot can I achieve this?

Environment : SP 2010

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
              fieldName: "CompanyCode"
           });
        alert(companyCode);

Let me know how can I achieve this?

Source Link
Gaurravs
  • 3.6k
  • 12
  • 23
  • 33

How to access custom property from User Profile using jquery

I have a custom property in User Profile called CompanyCode.

I need to fetch this property using javascript/jquery in a master page. Can anyone let me know how to fetch custom property from user profile.

I used

var companyCode = $().SPServices.SPGetCurrentUser({
      fieldName: "CompanyCode"
   });
alert(companyCode);

returned empty string.

Note :

I have also tried default properties but no result.

var companyCode = $().SPServices.SPGetCurrentUser({
          fieldName: "CompanyCode"
       });
    alert(companyCode);

Let me know hot can I achieve this?