UserInfo and adding properties

Forums SPJS-Utility UserInfo and adding properties

Viewing 2 reply threads
  • Author
    Posts
    • #6936
      Joseph Mayo
      Participant

      Hey Alex, I need to add some properties to the UserInfo oject when it loads, I know I can add them to the array of items in the code (but i hate changing other people’s code makes updating a pain). I also know there is the customProp parameter but that only takes 1 param.

      Any chance that can be updated to take several (comma sep. list or array)? In our example we want to add FirstName, LastName and UserName (login without Domain). without calling the spjs.utilities.userInfo multiple times (which would also override the last call).

    • #6973
      Alexander Bautz
      Keymaster

      I will add the ability to have the “customProp” as an array of FieldInternalNames in the next release of spjs-utility.js.

      In the meantime, you can modify your current version by changing this:

      if(customProp !== undefined){
      	arrOfFields.push(customProp);
      }

      like this:

      if(customProp !== undefined){
      	if(spjs.$.isArray(customProp)){
      		spjs.$.each(customProp,function(i,p){
      			arrOfFields.push(p);
      		});
      	}else{
      		arrOfFields.push(customProp);
      	}
      }

      Alexander

    • #7065
      Alexander Bautz
      Keymaster

      This has been added to spjs-utility.js. Read the change log.

      Alexander

Viewing 2 reply threads
  • You must be logged in to reply to this topic.