Hot answers tagged

10

I believe that the EditForm.aspx you are referring to (Workflow > Open task list > Forms > EditForm.aspx) is for the standard tasks in the task list. Workflow tasks, though they are in the same list, operate a little differently. Firstly, what type of workflow is it? Browser SharePoint Designer Visual studio Workflow tasks created by the approval ...


9

This is the way it works for me: <tr> <td valign="top" class="ms-formlabel"><nobr>Created by</nobr></td> <td valign="top" class="ms-formbody"> <SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server"> <CustomTemplate> <SharePoint:FormField FieldName="Author" ...


9

The below code access current user's department and manager from AD: SPSite _site = SPContext.Current.Site; ServerContext serverContext = ServerContext.GetContext(_site); UserProfileManager myUserProfile = new UserProfileManager(serverContext); UserProfile currentUserProfile = myUserProfile ...


9

You can do this by using the SPUtility.js library As example I have created a simple list with: Title (simple text). Country (ChoiceField) [Tunisia, Switzerland, Canada, France, Other] – Other is the default value. City (Simple text). By default the City field is hidden if the Country field value is Other. Every list has three default forms to add, ...


9

In SharePoint PreSaveItem function is called when onClick event handler is fired for Save button in List Forms. PreSaveItem function: function PreSaveItem() { if ("function"==typeof(PreSaveAction)) { return PreSaveAction(); } return true; } PreSaveAction function from another hand, allows to override behavior for a Save button. It ...


7

That is not the internal field name of the SharePoint field, it is how ASP.NET (ASPX pages) gives IDs to the fields when it renders them. You should never rely on those as they keep changing based on other controls on the page. In this case MS has probably pushed an update that has brought in one additional control to the page, causing incremented ID to all ...


6

An easier to implement option than an event receiver is a Workflow, triggered by the first list, to insert data from that entry into another list. This can be easily built using SharePoint Designer.


5

To create a form that would submit items to multiple lists, you should: Add some elements to your main list form, probably arranging them in a certain way. If those elements aren't related to fields as I suspect from your description, best way to do it would be to leverage OnPostRender CSR event and then use HTML5 selectors or jQuery to insert your HTML ...


5

You can use queryselector to reach the text inside the div: var textValue = document.querySelector("#allowances div").innerText;


4

One way at least is to use this CSS: .ms-formtoolbar { display: none; }


4

I am not sure i can understand correctly your question, but it seems to me that you want to submit a form via "original" save button. But would like to do your own code in between. If that's correct, what I usually do is to return 'false' in PreSaveItem. Then do all the things I need to do and then submit form with javascript like this: function ...


4

Create custom edit form using SPD so that DataFormWebPart is generated: Go to this form and edit it. Find the following code: <SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton1"/> Replace it with the following code: <input type="button" value="Save" onclick="javascript: ...


4

Here is the C# version of Anders answer as it was not as straightforward as I would have thought. public static void SetFormJSLink(this SPList list, PAGETYPE formBaseView, string jsLinkUrl) { var file = list.ParentWeb.GetFile(list.Forms[formBaseView].Url); file.CheckOut(); using (var manager = ...


4

If you want to customize a list new\edit\display form there is a couple of ways you can do it. I mean programming ways (not InfoPath). All this methods related to creating custom rendering templates. Every list form has its own rendering template, for list its a "ListForm", for document library "DocumentLibraryForm". All this templates (and otheres) listed ...


4

Have you considered email enabled libraries? Since 90% of your users do not have access, you should consider that to get the information or form into SharePoint. If you use InfoPath, you could possibly still do this with an email distributed form, then the completed form would be an attachment and could be emailed into the library.


4

Okay, so after some debugging I found the problem and, even better, the solution. The OK button on the attach form runs a script called OKAttach(), which features a line towards the end that reads: document.getElementById("idAttachmentsRow").style.display=""; All well and good, except that at some point SharePoint sneaked behind your back and did this to ...


3

You should not have to worry about how the dialog launches, it should happen seamlessly from the ribbon new button no matter the content type. I would check two things: Is the site operating with v4 (sp2010) visual styles? Is the list configured to show forms in a dialog. List Settings -> Advanced -> Dialogs -> Launch forms in a dialog? -> Yes The list ...


3

For 2010: Add this to the page in a content editor webpart, or add to the page layout <script language="javascript" type="text/javascript"> function DoAction() { var clientContext = new SP.ClientContext.get_current(); var web = clientContext.get_web(); var user = web.get_currentUser(); clientContext.load(user); ...


3

You can use jQuery to find the fields and apply css to them with something like: $("h3[class^='ms-standardheader']:contains('Assigned To')").css("font-weight", "Bold"); $("h3[class^='ms-standardheader']:contains('Description')").css("font-weight", "Bold");


3

I had a glance in the AttachmentsField.UpdateFieldValueInItem call to see where it gets the list of files from for its own use. It appears to use this property: AttachmentsField.Context.Request.Files, the documentation for which is here: HttpRequest.Files Edit: I suddenly realised that you may be trying to access the control in order to save the ...


3

You're probably looking for InputFormControl. It should be placed inside Template_Control tag of InputFormSection control. In header section of your custom user control, you will need to add the following code: <%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/InputFormSection.ascx" %> <%@ Register ...


3

Robert... This time, dont use relative URLs, just add absolute URL (the entrie path of the page) eg. <input type="button" value="Add List Item" name="BtnSave" onlick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect{http://<server>/sites/<site name>/Pages/<page name>.aspx}')}" /> It should work, cheers


3

The best practice approach is to make copies of each of the forms then edit the copies. Then on the custom forms you can add in custom list form web parts and style and change until your heart's content. With SharePoint 2010, you can also utilize InfoPath to customize the forms pretty easily. Here (from MSDN) is a nice excercise on that process.


3

This looks like good place to start: Custom SharePoint List Forms It will give you some insight on what can be done. Replacing default forms with custom application pages is briefly explained at bottom of the article. I am very fond of this technique but I never come across some really good article that explains everything.


3

Can't resist mentioning, that the "Open" button on the ribbon and the link on the folder title are still there, and they really do the same what you want, with only one click cost. Anyway, certainly there are several approaches to achieve what you want. Approach 1: iframe I believe the most simple way would be what I call "dirty js hack"... It is NOT ...


3

If you have followed the steps correctly, it should work. Make sure that, once you have created the application page, the solution explorer structure looks like this - Deploying this will create the folder and files for you inside the "Layouts" folder.


3

A couple of issues: The Id part of SPFieldLookupValue should be the Id of the listitem in the list with groups (Groups?) not the Id of the item you're updating. So ideally you setup the ddlGroups with Text=Text from Groups and Value=Id of corresponding listitem in Groups. The code to populate the ddlGroups should be changed to: foreach (SPListItem ...


3

Another way to do it (if "Open with Explorer" works for you) In the form library, on the ribbon navigate under "Library Tools" to the "Library" tab. In the "Connect & Export" section find "Open with Explorer". Depending on your screen resolution the full label may not be displayed; the icon looks like a folder with an arrow pointing to a computer ...



Only top voted, non community-wiki answers of a minimum length are eligible