I need some guidance on auto-populating fields in Information Panel and EditForm.aspx.
For example i have a field that is Approver and Approver's Department. I would like to populate the Approver Field with CURRENT LOGIN USER and based on the CURRENT USER, i would like the Approver's Department to populate with department that the Approver is from...
Many Thanks Ahead!
Loading
Bhushan GawalePosted Sep 28, 2010, 4:51 AM
when you add / update / delete something in sharepoint lists/ document libraries then those events can be catched by using SharePoint Object Model
you need to write a class inheriting from SPItemEventReceiver , then override methods like ItemAdding/ItemAdded..(Methds with 'ing' suffix will be called before actual event happens)
you can get something like here
after creating this classs , you need to register these events with your list / document library
you can have look at this link for this
Peterson YapPosted Sep 28, 2010, 3:17 AM
Bhushan GawalePosted Sep 27, 2010, 6:08 AM
try googling
here is something I found similar to what you are trying to do
http://www.endusersharepoint.com/2010/05/03/set-up-sharepoint-list-to-auto-populate-user-information-screencast/
http://www.petestilgoe.com/2010/01/how-to-auto-populate-infopath-forms-using-the-people-picker/
hope this helps
Peterson YapPosted Sep 27, 2010, 1:57 AM
Bhushan GawalePosted Sep 27, 2010, 12:57 AM
please note that while working with Document Information Panels , it is one of the method to add checks for metadata of the document sothat when any document uploaded to document library will have certain fields for sure
so, as Infomration Panels are opned at client site so you cant do the trick to populate fields automatically by using current users id , you need to do some custom coding
what I can suggest is , rather than autopopulating fields in Information Panels, you can write event receiver for your document library and check or populate metadata on ItemAdding Event
hope this helps
Peterson YapPosted Sep 21, 2010, 11:09 PM