mrackley / StratusForms

Lightweight InfoPath alternative for SharePoint 2007,2010,2013,2016,2019 and Office 365
82 stars 36 forks source link

New Peoplepicker field error #58

Closed btroop202 closed 5 years ago

btroop202 commented 5 years ago

So I have an existing StratusForm page and it is working great. But had to add a new peoplepicker to the form, works great on any new record. But when I go to edit an old record, the input area does not show and I get an error when I try to save the form.

The error is from the stratus-forms-data-SPServices-1.4.js file, the function below returns a unknown error

$.fn.StratusFormsGetPeopleFromPeoplePicker = function (element) { var spPP = SPClientPeoplePicker.SPClientPeoplePickerDict[$(element).attr("id") + "_TopSpan"]; var people = spPP.GetAllUserInfo();

return people;

}

btroop202 commented 5 years ago

To fix the issue I had to add a try catch in stratus-forms-data-SPServices-1.4.js

$.fn.StratusFormsGetPeopleFromPeoplePicker = function (element) { var spPP = SPClientPeoplePicker.SPClientPeoplePickerDict[$(element).attr("id") + "_TopSpan"]; try { var people = spPP.GetAllUserInfo(); } catch(err) { window.console.log(err.message); } return people; }

mellolr1 commented 4 years ago

Similar issue using stratus-forms-data-SPServices-1.55.js. Existing form with existing data worked ok with 1.55a beta, but needed the try/catch to avoid that error.