10 Replies Latest reply on Sep 12, 2012 10:53 AM by philmodjunk

    Clearing Radio button in Portal?

    bookalaka_1

      Title

      Clearing Radio button in Portal?

      Post

           Good Morning,

           Developing script to clear the "Sort" radio buttons selected in my portals. My script works only on the first record? I thought of looping but I don't think its really necessary as my other global fields that use text clear perfectly?

           This is what I have for my Script:  Set Field[Products_4select_e::Sort;""]

           Portal filter is ( IsEmpty ( Order_Entry::gS_Sort ) or PatternCount ( Products_4select_e::Sort; Order_Entry::gS_Sort ))

            

           These are how my other Global fields are filtered using a similiar script that works perfectly.

            

           ( IsEmpty ( Order_Entry::gS_Country ) or PatternCount ( Products_4select_e::Country_LK; Order_Entry::gS_Country )) and
           Order_Entry::gS_Vintage = Left (Products_4select_e::Code_Vint; Length (Order_Entry::gS_Vintage ) )and Order_Entry::gS_Code = Left (Products_4select_e::Code_PB_pk ; Length (Order_Entry::gS_Code ) )
           and Order_Entry::gS_Size = Left (Products_4select_e::Code_Size; Length (Order_Entry::gS_Size ) )
           and Order_Entry::gS_LOV = Left (Products_4select_e::LOV; Length (Order_Entry::gS_LOV) )
           and( IsEmpty ( Order_Entry::gS_ItemDescription ) or PatternCount ( Products_4select_e::c_ItemName;Order_Entry::gS_ItemDescription ) )
           and (IsEmpty (Order_Entry::gS_PriceHigh)or(Products_4select_e::Price_FPB_LK  ≥ Order_Entry::gS_PriceLow and Products_4select_e::Price_FPB_LK  ≤  Order_Entry::gS_PriceHigh))

            

      UnSelected.png

        • 1. Re: Clearing Radio button in Portal?
          bookalaka_1

               Another screen Shot when selected.  I wish to clear all

          • 2. Re: Clearing Radio button in Portal?
            philmodjunk

                 The field you are clearing does not appear to be a global field. Thus you need to clear this field for each record shown in the portal.

                 You can either loop through your portal rows with Go to portal row or you can freeze the window, pull up this same set of records on a layout based on the portal table and use a single Replace Field Contents step to clear the field.

                 To pull up the records shown in a filtered portal can be a bit of a challenge, you'd start with Go To Related Records, then use constrain found set to filter the found set down to those that meet the current values specified in your filter expression.

            • 3. Re: Clearing Radio button in Portal?
              bookalaka_1

                   Why isn't it a global field? I have set up as global Text field and have the relation ship as gS_sort:: OrderEntry X Sort::products4select

                    

                    

              • 4. Re: Clearing Radio button in Portal?
                philmodjunk

                     Set Field[Products_4select_e::Sort;""]

                     doesn't clear the global field gS_Sort, it clears a field named Sort--the naming convention and the way it appears in your screen shots (assuming it is the radio button listed on every portal row) suggested to me that it is not a global field. I could easily be wrong, I'm just going by appearances here.

                • 5. Re: Clearing Radio button in Portal?
                  bookalaka_1

                       Im trying to use like my other global fields difference being the button instead of text this is where I got into the problem.  So yes I have a global field gS_Sort from my parent table to a field called "Sort" in my child. I wish to selct items I need to create a report and then when finished clear the buttons.

                  • 6. Re: Clearing Radio button in Portal?
                    philmodjunk

                         Yes, but the set field step that clears a field that you original posted does not clear the gS_Sort field. if gS_Sort field is a global field and your set field step were:

                         Set Field [ Order_Entry::gS_Sort ; "" ]

                         instead of:

                         Set Field[Products_4select_e::Sort;""]

                         Then that single script step should clear the gS_Sort field.

                    • 7. Re: Clearing Radio button in Portal?
                      bookalaka_1

                           Maybe Im missing something here. The Order Entry Table that uses all of the Global Fields be it name, Item size etc are all  gS_ they all share a code or number in common. I just ran a test and the field is an edit box instead of a button and enter "Yes" the gS_Sort::Order Entry script does clear. however as a radio button it does not??? somehow it being a radio button is the difference. is there an other value I should be clearing

                      • 8. Re: Clearing Radio button in Portal?
                        philmodjunk

                             Please read my previous posts very carefully. Going from what you have posted, your script clears the wrong field. It does not clear the gS_sort field. It clears a field of a different name.

                        • 9. Re: Clearing Radio button in Portal?
                          bookalaka_1

                               After much experimenting your suggestion of  "freeze the window, pull up this same set of records on a layout based on the portal table and use a single Replace Field Contents step to clear the field." is the correct one. While I have this assigned as a global field I realize the information isnt common to every record  and when clearing the Global field will not do what I need. 

                          Would you have an example file that uses the "Freeze window go to other layout function"

                                

                          Thank you for the help.

                                
                          • 10. Re: Clearing Radio button in Portal?
                            philmodjunk

                                 The basic outline would be:

                                 Freeze Window
                                 Go to Related records
                            Enter find mode
                                 Specify find criteria to "filter" the records
                                 Constrain found set

                                 Replace Field contents
                                 Go to layout [original layout]

                                 Go to Related Records will pull up all related records so you would need the steps shown in blue to filter out those records currently excluded from the portal by your filter expression. You'd use a series of set field steps to specify criteria in different fields to reproduce the logic of your portal filter calculation.