Property in UserProfile has a “-” but JS won’t recognize
- This topic has 1 reply, 2 voices, and was last updated 5 years ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › Classic DFFS › Property in UserProfile has a “-” but JS won’t recognize
Tagged: Custom JS
One of the properties I can see in concole is “Band-Level” but thw following code doesn’t recognize it. If I use any property with no – it works fine but adding “Band-Level” makes it error.
`function populateBand() {
// Use this code in NewForm or EditForm
$.each(spjs.utility.getFieldValue({“fin”:”Band_4_Approval”,”key”:”loginName”}),function(i,login){
//var ppData = spjs.utility.userInfo(login);
//console.log(ppData);
// User profile is not available in SP Foundation
var userProfile = spjs.utility.userProfile(login);
console.log(userProfile);
setFieldValue(“Approver_Band”,userProfile.Band-Level);
});
}
Write it like this:
userProfile["Band-Level"]
Alexander