[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2013-05-20
7
Medium Priority
?
1,601 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:
Clay Fox earned 1940 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:Clay Fox
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

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:Clay Fox
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:Clay Fox
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about creating a new Microsoft Online User Profile account along with how to transfer your files and settings. You may be faced with this situation if your existing user profile has become corrupted.
Manually copying shapes and their assigned macros one by one to a new location can be tedious, but if you use the Excel utility workbook attached to this article, the process will be much quicker and easier.
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.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

607 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