UserInfo and adding properties
- This topic has 2 replies, 2 voices, and was last updated 11 years, 9 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › SPJS-Utility › UserInfo and adding properties
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).
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
This has been added to spjs-utility.js. Read the change log.
Alexander