Programmatically disable Views in InfoPath 2007 - InfoPath Dev
in

InfoPath Dev

Programmatically disable Views in InfoPath 2007

Last post 05-10-2012 07:41 AM by daphnerby2012. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-24-2008 08:39 AM

    Programmatically disable Views in InfoPath 2007

    Is there a way to programmatically disable views (or make read-only) in InfoPath 2007?

    Problem 

    I have a Customer Profile document that needs to be web-enabled using InfoPath 2007.  The document has several sections.  Each section has textboxes and drop down lists.  InfoPath 2007 will be used to Add new customers and Edit existing customers.  The InfoPath form will be published to SharePoint (possible to a custom list).

    When a New form is filled out, different people will fill out different sections.  For example, Jane will start out by creating a new form and fill out the only Section 1.  As part of the Workflow, John will come in next and only fill out Section 2.  Then Paul will only fill out Section 3.  At the end of the Workflow, someone else is notified by email.

    The tricky part is that each person should only have permissions to edit their own designated section.  They can "see" the other sections, but should not be able to edit them.

    Possible Idea

    One idea was to create separate Views in InfoPath for each section and then programmatically disable, or make read only, the views that they don't have access to.  They should be able to see the data on the View, just not edit any of it.

    Question

    Is there way to programmatically disable Views, or make read only, through code?  Or if not an entire View, is it possible to disable, or make read only, different fields on the form programmatically?

    Your assistance is much appreciated...Thank you!

     

     

  • 04-24-2008 09:05 AM In reply to

    Re: Programmatically disable Views in InfoPath 2007

    Welcome to the forum.

    I would recommend having the following views.

    view1   section1   editable

    view2  section1 Expression boxes  Section2  editable

    view3  section1+2 Expression boxes  Section3 editable

    view4 All Expression Boxes (Read Only)

    With these workflow scenarios there are two major components.

    1. You need to be able to identify the form user.  I use an Active Directory web service so that I can also retreive their department, phone, email, location, manager, etc.  You can even check group membership and control permissions within the form based upon their groups.

    2. You need to track the state of the form. Each time it is submitted the state field is updated to keep track.

    With these two components you can perform the logic you need for each step of the workflow.

    Typically

    I would identify the original requestor in the form and the next two approvers and store there user alias in the form.  Then it routes to them via email or filtered list and when they open it in open rules they are verified with the approver data and either shown the form or rejected. If a requestor opens an inprocess form they get the read only view, etc.

    If you would like to see some examples send me an email.

  • 05-23-2008 10:43 AM In reply to

    Re: Programmatically disable Views in InfoPath 2007

    Clay:

    At the risk of hijacking the original request, I have a similar issue and would value your suggested solution.

    First, I'm using Office 2007 for everything.  I have a set of information to be colleced in InfoPath that will be best parsed into 8-10 views.  (the info to be collected deals with complex construction projects; many technical variables that need to be considered & documented).  To date, the form is designed in one view.  It looks great, and I'm heading towards publishing stage, but have some questions related to navigation, and probably some role definition based on what I read in your response above.  My plan is to create the 8-10 "working" views, COPY, paste & segment the InfoPath content from the one master view that exists, and onto the right view.  Buttons will be used on each view to navigate to other views.  (You and some other masters on this board helped me figure out stacked button labels which are now working great..  thx :-))

    In terms of usage/workflow: the form I'm working on serves to collect the information; this by itself will be a tremendous help to my organization.  Later, and when I'm able to figure it out, the data in the InfoPath will be used to populate MS Word templates (proposals) that will dramatically improve our ability to respond those waiting on us to get this complex info organized.  Until I figure out InfoPath-to-MS Word tricks needed to get the proposals more automated, I just want my team to begin using the InfoPath form to collect the data.  My team includes 3rd party salespersons that I'm expecting to collect the information.  With all this as framework, my question is:

    When I get my 8-10 "working" views in place - their content redacted from the master view - I will still have the master view that shows all the questions in one place.  Prior to publishing the form, is there a way to disable that master view so that users only see the 8-10 "working" views?  (It seems like the master view should always be there, and then I would copy any changes made to the master view to the other "working" views.  Is that the best way to administer this monster form?  I know I will be making changes to it regularly and re-publishing.

     Thanks!  chris 

  • 05-23-2008 05:09 PM In reply to

    Re: Programmatically disable Views in InfoPath 2007

    Hey Chris.

     It sounds like you are living the InfoPath life, creating a great solution for your company, very inexpensivly and with out needing a developer.

    The challange you will find is that the reason why enterprises have server architecture is that you need some central systems for organizing groups of people. If you only have desktops to work with you face a lot of limitations and frustration. The Office suite is good but limited when working as a group or when the data is locked up in a single document.  I would try and get a server so that you can really acheive what you are capable of. It will give you much more potential to streamline the business.

    I would recommend you just create print views in InfoPath.  What are the drivers for using Word? It adds a lot of complexity and I am not sure it is justified.  Do all of the participants in the form have InfoPath?

    You need a way of identifying the user and then you can route them to the appropriate view when they open it or hide views from them..

     If you want to discuss further feel free to email me.

  • 05-29-2008 03:52 PM In reply to

    Re: Programmatically disable Views in InfoPath 2007

    Clay.. did you get my email?  I definitely could use your help!

  • 02-24-2009 04:22 AM In reply to

    • firouz
    • Top 500 Contributor
      Female
    • Joined on 02-24-2009
    • Iran
    • Posts 51

    Re: Programmatically disable Views in InfoPath 2007

    Dear Clay

    What do you mean by Expression Boxes? How can I make a section editable, and make an other Section read only, in the different views. maybe I should make all countrols read only one by one instead of whole Section at once?

    thanks

     

  • 02-24-2009 04:53 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Programmatically disable Views in InfoPath 2007

    Hi,

     

    If you are using Infopath2007 and you need to change complete view read only, then you can follow below steps:

     
    1. Open Form in Design mode.
    2. Switch to Views tab.
    3. Double click on the view to open View Properties.
    4. Select “Read Only” check box in the General tab.
    5. Click on ok.
     

    If you want to display some fields read only and some fields editable in same view, then you need to set one by one field Readonly.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 02-24-2009 11:22 PM In reply to

    • firouz
    • Top 500 Contributor
      Female
    • Joined on 02-24-2009
    • Iran
    • Posts 51

    Re: Programmatically disable Views in InfoPath 2007

    Dear Anuma

    thanks for your reply

    But I want to make a SECTION read only. not Fields neither Views. Is it Possible in infopath 2007?

  • 02-24-2009 11:38 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Programmatically disable Views in InfoPath 2007

    We cann't make a section ready in infopath. We need to add conditional formatting for every field in that section.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 02-24-2009 11:45 PM In reply to

    • firouz
    • Top 500 Contributor
      Female
    • Joined on 02-24-2009
    • Iran
    • Posts 51

    Re: Programmatically disable Views in InfoPath 2007

    Thanks Anuma

    I think I got My Point

  • 02-25-2009 11:05 PM In reply to

    • firouz
    • Top 500 Contributor
      Female
    • Joined on 02-24-2009
    • Iran
    • Posts 51

    Re: Programmatically disable Views in InfoPath 2007

    Hi Anuma

    I have a problem again

    I have 2 views in my form. At first one user open the form and see his View ( View1) and fill it and save and closed the form. then after a while, the form again will be open by another user. this new user has another View (View2). in This View he shoule be able to see the disable view of last entered data, and new section for himself that is editable.

    How can I save the data from View1 and show it in View2 ??

    And after closing form and open it again how can it understand to open which view ?

    Appreciate your help dear Anuma

  • 02-26-2009 03:58 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Programmatically disable Views in InfoPath 2007

    Hi,

    Copy your View1 data (Which is you want to display in the second view) into the View2 and paste it. For more idea verify attached xsn. I have added Open rules to switch users.

    Let me know still you have any issues.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 02-26-2009 05:24 AM In reply to

    • firouz
    • Top 500 Contributor
      Female
    • Joined on 02-24-2009
    • Iran
    • Posts 51

    Re: Programmatically disable Views in InfoPath 2007

    hi

    thanks Anuma. I have no problem yet. it works properly

  • 06-22-2009 07:57 AM In reply to

    Re: Programmatically disable Views in InfoPath 2007

    I have a need for conditional access to a view as well. My need is a bit different.

    Right now, I have a form which has a number of controls that I do not wish to display to the user of the form. They contain values that are retrieved and used behind the scenes.

    I could just delete the controls for these fields, but if there are problems, debugging would be much more difficult, since I would no longer be able to see what was going into those fields.

    So I was thinking that I could set up the conditional display for the controls to hide them in the default case. But to do that, I need some sort of condition.

    So I was thinking that if I could create a view only accessible (perhaps only seen?) by people in my group who might have to debug this application, and in that view place a "display hiddend control" checkbox that, by default, is not checked, and set the conditional formatting for the controls to not display if that checkbox is not checked, then I have a sort of built in debugging aid.

    Other people wouldn't see the view, so they wouldn't pick at it.

    The certain people who could see the view would not, in general, mess with it, and even if they did, it wouldn't hurt processing.

    So, if there is some non-workflow method to conditionally hide the views, that would be helpful in setting up the debug mode.

     

    http://wiki.tcl.tk/
  • 06-22-2009 10:17 AM In reply to

    Re: Programmatically disable Views in InfoPath 2007

    I would just go to the view settings and uncheck the box that makes it visible in the Views dropdown/list.  Then, in design mode, you can always switch to it for testing.  If you are on a specific view when you click Preview, it previews in that view, which allows you to do testing.  If you need to do the testing live in browser or client mode from the server, then create a button or checkbox that is only visible to admin and have a rule behind that button that switches the view.

Page 1 of 2 (17 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.