Knowing which View I’m in when a browser form is created from a URL link which includes ‘&DefaultView=XXX’ - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Knowing which View I’m in when a browser form is created from a URL link which includes ‘&DefaultView=XXX’

Last post 02-18-2020 07:59 AM by merley72. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-12-2020 10:22 AM

    Knowing which View I’m in when a browser form is created from a URL link which includes ‘&DefaultView=XXX’

     Hi

    I currently have a browser form for new documents which is used through Office 365 and it gets launched from a web-page using a Links webpart on the page.  The form has three views in it which I’ll call AAA, BBB and CCC for this example.  On the Links webpart are three URL links and each opens up the same form, but into a different View by using the ‘ &DefaultView=AAA (BBB / CCC) ‘ as an appendix to the URL. 

    It’s great and all would be well except that I need a field in the form to be set to be the name of the relevant View used at creation/first opening time.  The reason for this is that a choice field uses the AAA, BBB or CCC as part of a lookup criteria for Approval names.  So if it’s an AAA version it displays John, Fred and Mary in the Approval list, but if it is a BBB, then I want Mary, Peter and Susan to display.

    Obviously I can set the default of that field to be AAA, but I’d like it to automatically change to BBB or CCC as appropriate.  If there was some way I could inherit the XXX from the ‘DefaultView=’ part of the URL into the field I’d be happy, but I’m struggling with this.  It all needs to happen with no user interaction at all really. 

    Please ask any questions you need if I’ve not been specific enough and I will be very grateful if anyone can suggest a way for this bearing in mind it is an Office 365 application.  Thanks in advance.  Alan C.

  • 02-18-2020 07:59 AM In reply to

    Re: Knowing which View I’m in when a browser form is created from a URL link which includes ‘&DefaultView=XXX’

    I found a way to identify one of the 'Views' I was using which had a specific field being used. I positioned that at the top part of the form, and disabled all other fields until that one - a title field - was completed. I added a rule to that which basically set the value of the hidden parameter field to the correct value (in the example above let's say it set the field to 'CCC' instead of the default value of 'AAA'), and therefore when I want to look at the Approver field, it can compute the Approver names correctly. The other two Views were more complicated as they basically have the same fields being used on both. For one of these, I used a people picker as the source of checking and changing. In fact I didn't use the people field as you can't run Actions etc through that, so I used a text field with a refresh upon change default value of the Display Name from the people picker for all of the checking and control. The Name field was set to blank on creation, however as it was a mandatory field, and I could then force it to check and differentiate which sort of document I was creating (either an AAA or a BBB) and reset the Approver parameters accordingly. So complicated but eventually successful. If others need help or would like further information around this I would be happy to share. Alan C.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.