8 Replies Latest reply on Aug 28, 2013 7:12 AM by Vicky

    Need to create new record to make portal filter?

    Vicky

      Title

      Need to create new record to make portal filter?

      Post

           Hi,

           I am trying to get a portal filter to work, but in order to make the portal filter work, I have to create a new record.  Is there any way to fix this problem?

           I am still adjusting the calculation for the filter.  My boss wanted it to filter out models with the individualETAStatus of "Open" or "Ship" that had the status of "Closed" before. 

      Screen_Shot_2013-08-27_at_12.26.53_PM.png

        • 1. Re: Need to create new record to make portal filter?
          philmodjunk

               The expression you are using in the portal filter makes no sense. This expression must evaluate to True, False or a numeric value. (Number results other than 0 or empty are True, results of zero or empty are False.)

               And if the user modified a field or variable referenced in that portal filter expression, the records shown in the portal will not update to show the change in filter criteria without a bit of help.

               The script step: Refresh Window Contents [ Flush cached join results ]

               Can force the portal to update, but every part of your layout/found set updates so this can trigger significant delays refreshing the window in some cases.

               Using fields instead of variables and including those fields as match fields in the portal relationship can eliminate the need for refresh window. It might even eliminate the need for a portal filter expression or you may need to add them in with the X operator instead of =. (It depends on your portal filter as to whether or not it can be replaced by just using match fields or not.)

          • 2. Re: Need to create new record to make portal filter?
            Vicky

                 Thank you for the quick reply!

                 If I write the expression like this:

                 If ( OrderLineItems|ByOrder 2::individualETAStatus = "Closed" ; True ; OrderLineItems|ByOrder 2::individualETAStatus = "Open" or OrderLineItems|ByOrder 2::individualETAStatus = "Ship" )

                 does it make sense?

                  

            • 3. Re: Need to create new record to make portal filter?
              Vicky

                   Or is it suppose to be 

              If ( OrderLineItems|ByOrder 2::individualETAStatus = "Closed" ; False ; True) ?

                   But then how can I tell the portal to filter out only models that have never been closed before?

              • 4. Re: Need to create new record to make portal filter?
                philmodjunk

                     Your first example will return a true or false result for each possibile way that the If funciton can evaluate. You may find that a Case function is easier to work with however.

                     Or you could use this exrpression:

                     OrderLineItems|ByOrder 2::individualETAStatus = "Closed" or 
                     OrderLineItems|ByOrder 2::individualETAStatus = "Open" or
                     OrderLineItems|ByOrder 2::individualETAStatus = "Ship"

                     and not use any If function at all

                • 5. Re: Need to create new record to make portal filter?
                  philmodjunk

                       Or for that matter, you could use:

                       PatternCount ( "ClosedOpenShip" ; OrderLineItems|ByOrder 2::individualETAStatus )

                  • 6. Re: Need to create new record to make portal filter?
                    Vicky

                         Thanks Phil! I tried out your suggestions, and the expressions make sense to me but it does not do what my boss wants.  I'm sorry, I think I am not explaining what my boss wants very well. 

                         Say there are 3 orders of model f1m1. 

                         If the status of all three orders are open or ship, then it will show up on the portal.

                         If one of the three orders has the status of "Closed" , then f1m1 will not show up on the portal.

                         Is it possible for the portal to filter like this?

                    • 7. Re: Need to create new record to make portal filter?
                      philmodjunk

                           So if any one of the records has a status of "closed", NONE of the records should show in the portal?

                           If that is what you want, I believe that you could use this expression:

                           IsEmpty ( FilterValues ( List ( OrderLineItems|ByOrder 2::individualETAStatus ) ; "Closed" ) )

                      • 8. Re: Need to create new record to make portal filter?
                        Vicky

                             Oh wow!! It worked perfectly!!! Thank you Phil!