Solved

Populate Textbox with Title of Current View in InfoPath SharePoint List Form

Posted on 2013-05-20
7
1,294 Views
Last Modified: 2013-06-04
Hello,

We have a SharePoint 2010 list form which we have been modifying with InfoPath. We have three separate views for adding new data. The user can select which view they want based on what type of record they are trying to enter. Each view prompts for a different set of fields. There is simply a single list. It is permissible for records to omit fields based on the type of record being entered; hence the multiple views, each of which including a different set of fields from the list to be populated.

One of the things we do need to do is have a textbox where the user enters the name of the record type they are entering. This is redundant, however, as the view they are on is the record type. So, if the view is "ABC Record," they would need to enter "ABC Record" into the textbox to track that the record was of that type.

We have a technologically illiterate user base so we have set it up with a landing page and three buttons. Each button links to a separate SharePoint page, where the InfoPath Web Part has been embedded, already linking directly to the appropriate view for the button the user selected.

In looking through the Internet, it appears that retrieving the current view name is actually far more difficult than it ought to be. I would have hoped to simply create a rule for Page Load, which would set the textbox in question to be equal to something like CurrentPage.ViewName, or something of that nature.

Everything I have read points to no solution quite so elegant. Is there something I am missing? A few solutions mention how to grab the current view name as the view is changing. That really isn't applicable to our situation, however, where we are embedding the InfoPath Web Part with the view pre-selected based on the page the user lands on.

Is there any XSLT, XQuery, Expression, etc., to accomplish this? I am hoping for something really simple, a solution basically where I can set a field equal to the name of the current view. I had hoped to do this with a button I created for submitting that I placed at the bottom of the page; but it only gives me formatting rules; everything else, such as action rules, are grayed out.

Thanks!
Joseph Irvine
0
Comment
Question by:jkeagle13
  • 4
  • 3
7 Comments
 
LVL 28

Accepted Solution

by:
clayfox earned 485 total points
ID: 39182904
The simple answer is just have a column for the record type.  I assume you may already have one in the list to designate this, if not add one.

Then have the button set this value to one of your three choices (based on the button they select) right before it switches to the view.

Have a rule on open which switches to the view that corresponds to that value. This way when they edit or look at an existing entry it will go to the correct view.

Yah you have to hardcode the values to each of your views, but with only three views I am guessing it would not require much maintenance. Only if you wanted a new type.
0
 

Author Comment

by:jkeagle13
ID: 39183038
I do have a column for type, and could have the form switch views on open based on user selection.

How do I set up a receiver in the InfoPath list form to read a value passed in concerning which button was pushed? And, how do I set the button to push a unique value corresponding to the view intended by the SharePoint button inside a CEWP on the landing page we built to the SharePoint InfoPath form?

Thank you!
0
 
LVL 28

Expert Comment

by:clayfox
ID: 39183062
You would have each of the three buttons on the new record set the specific type and then do not manipulate it after that until it saves.

put three open rules on the InfoPath form.
one if type equals first then switch to first view and so on.

not sure if you want a specific button in the list but you can certainly filter the list by type.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:jkeagle13
ID: 39183100
Hello,

Right now my buttons are actually just PNG files on a blank page I have designated as a landing page, with hyperlinks to three SharePoint pages, each having the embedded InfoPath web part with a property of the view that page should represent.

How do I repurpose those to set "type," or create new buttons which set a "type" readable by an InfoPath load rule? I am afraid I have never set and passed a type using a button in SharePoint. Please feel free to defer to a site explaining the process as I didn't readily find one in a Google search, likely meaning I was using the wrong search terms.

I would just delete two of the three pages with embedded InfoPath web parts and have a single one, I presume, for which these buttons would dictate which view to load. I am just missing a piece or two of how to do that, but believe I am closer to understanding.

Thank you!
0
 
LVL 28

Expert Comment

by:clayfox
ID: 39183116
If there is a separate form for each list then just hardcode  the type as a default in each form. I guess I do not understand, I thought it was one list not 3.

do you just need to know how to link to a new template?
0
 

Author Comment

by:jkeagle13
ID: 39183180
Hello,

One SharePoint list, one InfoPath form, and three views on the form.

I have three SharePoint pages, one for each view. Each page has an InfoPath web part with the view desired specified in the web part properties.

I have a main page with three PNG images, each hyperlinked to the intended page with the embedded InfoPath form view.

I want it such that I can know in the form which view the user is using so I can set the column in the list with the name of the view.

Thanks!
0
 
LVL 28

Expert Comment

by:clayfox
ID: 39183225
So when they start a new record it is blank and foes to the default view right? Or you default to a specific view?
if you have a button for them to select the view they want change the value along with the view. When they save it will have the last view chosen and should then filter into the correct view in SP.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Outlook Free & Paid Tools
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now