Switch to two different views from one view - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Switch to two different views from one view

Last post 11-13-2007 06:24 PM by basheer. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-01-2007 03:05 PM

    Switch to two different views from one view

     Hi,

    How do I do the following:

     I have 5 views let's call them view A, view B, view C, view D, and view E. Each view has a 'Next' view button. When I'm at view A and click the 'Next' button, It should take me to view B. When I click on the 'Next' button in view B, it should take me view C. 

    When I'm in view D and click the 'Next' button, it should take me to view B (same view mentioned above). From view B and click the 'Next' button, it should take me to view E (a different view than mentioned above).

    I know how to use rules to switch to a different view, but don't know how to switch to two different views from one view (view B) when a 'Next' button is clicked.

    I'm using InfoPath 2003 sp 2

     I wish I could draw a diagram of the views to make it clearer.

     

  • 05-01-2007 10:13 PM In reply to

    Re: Switch to two different views from one view

    Hi bear1114,

    Try to make logic, you have only views and if you are going from B to either C or E. So you have to set a condition based on that you can switch to the view what ever you want.

    Take another field and  While setting the rule on the button set the field value as the present state. Let us take the value 1, 2, 3, 4, 5 to view1, view2, view3, view4, view5 simultaneously.

    Now while setting the view on the button set the extra field to the value that we assumed previously. In view B set the two view like this.

    If extra field value = 1 then switch to view c other wise

    if extra field value = 4 then switch to view e.

     

    Hope you understand the situation, and also hope this will help you.

    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 05-02-2007 07:58 AM In reply to

    Re: Switch to two different views from one view

    Shiva has the idea. Try making a node on the secondary DOM to keep track of the 'state' of the form, and then weave that node into the view switching logic.

    Also, it might be easier if you just break the views apart more so that you don't have to use 1 view for 2 states.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-02-2007 12:32 PM In reply to

    Re: Switch to two different views from one view

    Sorry, I tried to figure out what Shiva wrote but I'm not sure whether what she wrote involves writing code or can it all be done using rules on the 'Next' button? I'm not experienced writing code.

    Matt, what is a secondary DOM?

  • 05-02-2007 03:19 PM In reply to

    Re: Switch to two different views from one view

    Let me try to simplify.

    You need to have buttons on each view which take you to another view. It sounds like you have the rules for this figured out.

    However you need some of the buttons to have some logic and check the users history (previous path through the form) and then pick which view to take them to. You need to create some flag fields, as Shiva and Mat have spoken to, to create some "bread crumbs" in your form.

    To do this you would need to keep track of the form state, or which views they have been to.  I would create some extra fields, maybe one for each view; ViewA, ViewB, ViewC, ViewD, ViewE.  I would make these a boolean, true or false or an integer.  True or false could be whether they had been to the view or not an integer could be incremented to keep track of how many times they had been to each view, if that was necessary. Then as they use the next buttons create another rule after the view switch that updates the appropriate flag field. For example when they open the form, View A might be set to true or 1. When they click the next button on view A it switches to view B and also sets the viewB field to true or 1.  Do this for each view change. So for the next button on viewB it would have two sets of rules with conditions. If ViewD field is false or 0 then switch to View C. If ViewD field is true or greater than 1 switch to viewE.

    This will give you the functionality you are looking for. This concept could be simplified or added to depending on your logic needs.

    Filed under: ,
  • 05-02-2007 10:52 PM In reply to

    Re: Switch to two different views from one view

    Hi bear1114,

     First dont try to think the logic here in the posts, make it practice with the sample. By doing step by step you will get the result After that try think the logic.

     

    My logic is that in the first view next button set the rule like this.

     Double click the next button and Add button -> Add Action -> Switch views (next view) click ok and again click Add Action -> Set a field's value.

    In the field text box take the extra field and in the value text box type the value "1", if the present view is view 1. Like that give 3, 4, 5 for view C, view D, view E simultaneously.

     

    After that in the view B, set the rule on the next button like this.

    Set the condition

    If extra field value = 1 then switch to view c and set the extra field value to "2" other wise.

    if extra field value = 4 then switch to view c and set the extra field value to "2" switch to view e.

    If you still confused try the Clay Fox's logic, it is also clear.

    Hope this will help you.

    B.Shiva Prasad
    InfoPath Dev,
    http://www.ggktech.com
    India
  • 05-04-2007 08:08 PM In reply to

    Re: Switch to two different views from one view

    I got it! thank you for your help...I appreciate it!
  • 11-13-2007 06:24 PM In reply to

    I want to open a second form in first form.


    Hi Shiva, 

    I want to see first form(I can not edit this form) and when I Click one button, then second form should open(this will be edit mode)

    I want to open a second form in first form.

    I am doing in InfoPath to add in SharePoint.

    Is there any way to do it

     

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