I want to give you a way to filter a repeating table with the help of a drop down.
Let’s say you have a list with with a column called Requests and one column that is called Defects. You could have multiple defects for a request and now you only want to show thoose defects for the request you have choosen.
First add a data connection to receive these three columns from your list.
On your form, add a drop down and configure it like this.
Now add this secondary data source as a repeating table to your form and delete those columns you don’t need to show in the form. Deleting them from the form doesn’t mean that you delete them from the data source, they will still be there if you need them. Afterwards it could look like this.
Let us add the rule to the repeating table that will do the trick.
Highlight the repeating table and click the button Manage rules in the ribbon. Add a new Formatting rule that looks like this.
The condition says: When”Request” in the secondary data source “is not equal to” the “MainRequest” in the main data source.
Now when you test the form you will be able to see only those defects that belongs to the request you choose.
I thought I would give you a way to handle multiple submits in a form. Lets say you have a form that should be filled by both students and ordinary attendees. There are some fields that are specific to the students like name of school and name of education and for the attendee we might have fields like title and name of company. When they make the submit we want to make sure all required fields are filled, but only the required fields for that kind of person.
First of all the person should make a decision if he is a student or an attendee, the form could look like this.
When the person clicks one of the buttons a field named listener is set to Attendee or Student. This decides which fields (or sections) that are displayed on the form. To handle the submit and validation of fields I have two submit buttons that looks the same but have different rules applied to them. They are both hidden if listener is blank or is set to the other buttons value.
Here is how it looks in design mode where both submit buttons can be seen and you also can see the message that is thrown if not all required fields are filled.
I think it’s a pretty easy way to accomplish what I was looking for and should be pretty simple for any one to use as well.
I found this blog post the other day and you can’t imagine the thrill I felt 🙂
This is something I have wanted to be able to do so many times and didn’t know how to, now I do and I want you to do as well.
As you can see (and read in the blog post) the saveLocation is set from where the template is located. I did a little change to route the save location to a place I decided. I also added a little change to wait until the page is loaded before the function is executed, always a good thing to do.
This is the original code:
and this is my modified one with a hard coded save location:
Here is another one that prompts to save the document in the logged in users local Document library.
As always when we are working with jQuery you have to make sure that you reference the location of that .js-file
As you know when you add a web part to a library page, like Allitems.aspx or a page of a custom view that you’ve made, the ribbon gets wacky. That’s because it doesn’t know which web part it should have its focus on.
So what could we do if we really want some information, let’s say above the library web part?
And the information should be able to edit in an easy manner without using SharePoint Designer (SPD).
In this example I have a top site and underneath this I have some sub sites that are created from a site template I made. The things we are going to do now is made to that template so it could be reused.
First of all we have to edit the page’s code a bit, so bring up the page in your favorite editing tool SPD!
Find where the web part zone for the library begins and add two DIV’s right before it starts, like this:
PlaceHolderMain" runat="server"> <div id="success"></div> <div id="error"></div> <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
As you can see I have added two DIV’s right after PlaceHolderMain with the ID’s of success and error. Don’t close this page, we are coming back here real soon.
What we are going to do now is to add some content to the success DIV.
First we need to have some content, right?
On the top site, let’s create a new Web Part Page, call it content.aspx and choose Full Page, Vertical.
Add a Content Editor to the page, click inside it, choose to Edit HTML Source…
…and paste this code:
</pre> <div id="<span class=">MyDiv"></div> <pre> The content within this DIV will be shown above the document library. <div> <ol> <li>To think about...</li> <li>And this as well...</li> </ol></div></div>
Ok, so now we have som content and as you can see the content is kept inside a DIV with the ID of MyDiv.
Now we are going back to the first page (where we have the library and added the two DIV’s) to add this information to the success DIV.
Let’s add som jQuery!
Find AdditionalPageHeader and add this code:
As you can see, first I have a reference to my jQuery file, you should replace the URL so that it corresponds to your environment.
Then in the next section we are loading the content in MyDiv into the DIV with the ID of success.
Now we are done!
Save all pages and try it, it should look something like this:
This way you can create new sites from this site template and just by editing the Content Editors in the page content.aspx you could update the contents on all sites.
Isn’t that nice?
I would like to share with you how you could open a form in a dialog in SharePoint.
- Add a Form web part on a page of your choise.
- Replace the code with this:
- Replace sitename and library with the ones in your environment.
- Click Save and OK in the web part and try it out!