Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2013-05-20
7
1,357 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

790 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