sharepoint 2007 - Custom List form - Autopopulate Manager -


I have a SharePoint 2007 custom list containing a column called 'manager', in which the user's manager (a line of text) .

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

I know that we can autopulate list form fields using JQuery to access the SharePoint's 'User Information List' as a webservice, as shown in the blog below the mark :

My problem is that the manager is not stored in 'User Information List' so I can not retrieve it

It's very easy, you can call a "CAMLQuer Y "," CAMLRowLimit "and" listname "below to declare" CAMLViewFields "I will explain this with the next code example:

You can get your CAMLQuery from one view of you In the list, the designer opens a form in SharePoint, I opened my view list anuncio.aspx and found the next code:

   & Lt; / OrderBy & gt; & Lt; / Query & gt; & Lt; ViewFields & gt; & Lt; FieldRef name = "title" /> & Lt; FieldRef name = "body" /> & Lt; FieldRef name = "end" /> & Lt; / ViewFields & gt; & Lt; Rolimit pand = "true" & gt; 30 & lt; / RowLimit & gt; & Lt; Toolbar Type = "Standard" /> & Lt; / View & gt;  

Then the query UML in your Javascript code depends on the query in your needs or your view list,

  var fields = " & Lt; ViewFields & gt; " + "From field field name = 'title' / & gt; + "From  + "From & lt; FieldRef name = 'expired' / & gt;" + "& Lt; / ViewFields & gt;" ; On query = "& lt; query & gt;" + "From " + "From & Field; FieldRef Name = 'Modified' ascending = 'False' / & gt; + "& Lt; / OrderBy & gt;" + "& Lt; / query & gt;"; After setting the CAML query in the variable, modify your script:  
  $ (document) .ready (function () {$ () SPServices ({operation: "GetListItems", async: false, listname: "your list name", CAMLViewFields: fields, CAMLQuery: query, fullfunc: function (xData, status) {$ (xData.responseXML) .SPFilterNode (" Z: line ") .Each (function () {var liHtml =" & lt; tr>  "+ $ (this) .attr (" ows_Title ") + '& lt; / TD & Gt; & lt; / tr & gt; "$ (" #tasksUL "). Attached (liHtml);})}}});}); & lt; / script & gt; & lt; table id = "Workgroup" & gt;  

Comments