Home › Forums › Classic DFFS › Different form for different view.
Tagged: #DFFSform
- This topic has 8 replies, 3 voices, and was last updated 2 years, 11 months ago by Alexander Bautz.
-
AuthorPosts
-
-
November 22, 2021 at 14:42 #35189
Hello,
We have task to convert SP10 on premise InfoPath form to DFFS.
In info path there is different form as per views for single list.Please see attached image, there is different view for single list in info path form.
How can i achieve this functionality in DFFs?
Attachments:
-
November 22, 2021 at 16:36 #35194
Hi,
I’m not sure I understand – what is in these views? – is it different NewForms (different set of fields shown)?If so you can for example set up different tabs matching the different “views” and initially only show a select where they select the view they want to use. In your DFFS form you set up a rule to trigger for each of the options – showing the correct tab.
Please note that you must check the “No reversion of this rule” if you set up multiple rules on the same field (one for each view to show).
Alexander
-
November 22, 2021 at 17:09 #35195
In info path forms there is option for design forms for different views.
check attached image (view in info path)in the new form, there is rule set and it is switch for according to two button in form.
check attached image (switch condition)For example, when user click on ‘Add shared service initiative’, form switch to shared service view from the default view.
My question is how can i achieve this in DFFS, how do i set rules for this?
Is there any option for diffrent views in DFFs?Attachments:
-
November 22, 2021 at 19:42 #35201
I think when you say “view” it’s the confusing part (to me at least).
If you are saying the form changes when you click a button, this can easily be accomplished by creating a toggle and based on if it is set to “Yes/On” the form can make a new tab or section appear.
If you are saying that based on a list view that you are starting from, when you enter a new item (or then access it in the future) the form will display differently, I have code that will find the view source and alter the form.
-
November 23, 2021 at 15:57 #35212
-
-
November 23, 2021 at 15:53 #35210
Yes,
I want to switch form design on toggle/two buttons.I have created two tabs, Tab0 and Tab1.
When toggle is set as Yes/true, i want to display Tab0 and for no/false i want to display Tab1.How can i achieve this?
Do i need to write code in custom js?
Please provide code which is use for switch between two tabs.Thanks in advance.
-
November 23, 2021 at 16:13 #35214
Native DFFS will do this without additional coding.
Create a rule and set the trigger to if the toggle is equal to checked. Validate on form load and field change.
Scroll down and under Visible tabs enter the uniqueID (Tab0) of the tab you want to show when it’s checked. Also under the Hidden tabs you can enter the uniqueID (Tab1) of the tab you want to hide when it’s unchecked.
That’s why DFFS is so nice – a simple rule can do a lot!
- This reply was modified 2 years, 12 months ago by SteveE.
-
November 24, 2021 at 06:51 #35226
Thanks, @SteveE
You understand describe perfectly, cheers for you….!I get the point of switching tab on toggle,
Now i wanted to switch tab bases on list view,
For example i have two custom views in list,
So total views in list,
1. All items
2. View1
3. View2Now, when user select View1 in list and click on Add Items, DFFS form with Tab0 design should display, and for View2 form with Tab1 should display.
How can i achieve this?
-
November 24, 2021 at 16:46 #35233
Add these two functions to your Custom JS:
function getIsFromView1(){ var sourceView = document.referrer.split("/").pop(); if(sourceView.indexOf("View1.aspx") === 0){ return true; } return false; } function getIsFromView2(){ var sourceView = document.referrer.split("/").pop(); if(sourceView.indexOf("View2.aspx") === 0){ return true; } return false; }
Now set up two rules using the trigger “Custom JavaScript function” where you add getIsFromView1 to the “This value” field in the first rule and getIsFromView2 in the same field in the second rule.
In the “Visible tabs” you put the name of the tab to show and in the “Hidden tabs” you add *.
Let me know how this works out.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.