سؤال

I have a SharePoint 2007 custom list with the column Manager.

When creating a new item I want the NewForm.aspx to autopulate the Manager field with the user's manager.

I know we can autopulate using JQuery to access Sharepoint's 'User Information List' exposed as a webservice, as per Marc's blog.

My problem is the Manager is not stored in the 'User Information List' so I can not retrieve it this way, anyone have any ideas?

هل كانت مفيدة؟

المحلول

Thanks Mike, - using MOSS, though half my question was if there was a jquery helper to query this webservice ;)

I did this by writing a custom webpart that using the object model to get the user manager and department.

I then tweaked the URL of the custom list form by adding ?ToolPaneView=2 to the URL. This enabled the edit page. I then added my custom webpart and hid it. Then I added a custom editor webpart which I hid as well. \ I modified the custom list form in SP Designer to use labels instead of form fields then I used the custom editor webpart to write some jquery to copy the values from my custom webpart to the label text.

phew! all that just for some standard auto form filling... :S

نصائح أخرى

Are you using WSS or MOSS? If you are using MOSS and have the manager field being populated from Active Directory then you can make a web service call to the UserProfileService and grab the user's profile, which will include that field.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top