2

I am getting the error "SPClientPeoplePicker is not defined in custom edit form". But it is working properly in default edit/new item form. (Sharepoint Online)

Getting the below error when trying to use it in custom edit form.

enter image description here

I need to use SPClientPeoplePicker to manage the people picker values in the custom form. Please help.

-- EDIT --

I've added the clientpeoplepicker.js file in to the default edit form.But still not able to get the people picker fields object (added screenshot below). I think people picker fields in custom edit forms are different than one in the default edit form.

enter image description here

1 Answer 1

4

Maybe you have to request the script on demand, try this in your code:

SP.SOD.executeFunc('clientpeoplepicker.js', 'SPClientPeoplePicker', function () {
    //awesome code in here
});
2
  • Sorry. It is not working in custom edit form. Still getting the same error. What I want to achieve is to automatically fill people picker fields, and I am able to do it in the default edit form. But not able to do it in custom edit form. Commented Mar 27, 2019 at 4:46
  • Can you post the whole script? Commented Mar 29, 2019 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.