4 Replies Latest reply on Jan 25, 2016 2:00 AM by aetherington

    Portal filter calculation help

    aetherington

      Good afternoon,  I have a portal which is currently filtered by a text field and related by a Reference number.  The Portal has the following Fields.

       

      Part Number | Part Description | Part EEE Code | ToUse Checkbox

       

      The Search box filters by part Description using the following calculation

       

      IsEmpty(FaultLog::partsPortalSearch) or PatternCount ( Parts List::partDescription ; FaultLog::partsPortalSearch)  and Parts List::callDetailReferenceNumber = FaultLog::callDetailsReferenceNumber

       

      I have attempted to make some changes but cant seem to get the results I am expecting.  what I would like to do is not show any parts that contain an EEE Code.  and have a field that they can enter an EEE code to make it appear,  I used the following calculation to hide any entries with an EEE Code

       

      IsEmpty(FaultLog::partsPortalSearch) and IsEmpty ( Parts List::partEEECodes ) or PatternCount ( Parts List::partDescription ; FaultLog::partsPortalSearch)  and Parts List::callDetailReferenceNumber = FaultLog::callDetailsReferenceNumber and IsEmpty ( Parts List::partEEECodes )

       

      But changing it so that if the EEE Search box is not empty, show that entry is where I am stuck. 

       

      If anyone could help that would be great.

       

      Thanks!

      -Ash

        • 1. Re: Portal filter calculation help
          user19752

          I'm not sure what you want, but you are better to use ( ) and line breaks in your conditions, if you use both "and" and "or".

          I guess you don't want to calculate them one by one left to right.

          • 2. Re: Portal filter calculation help
            MaxEh

                          I have a portal which is currently filtered by a text field and related by a Reference


            I am assuming (always a bad thing) that your portal is displaying all records based on your current "filter" or relationship. Is this done using the portal filter check box in the portal set up dialogue? If not then the solution could be as simple as checking the portal filter box and setting the calculation as


            IsEmpty ( Parts List::partEEECodes )

            As soon as you enter something into the field it is no longer empty and not a part of the portal (you may need to refresh the portal).


            You could use a Tab Control to switch between to views - one with isEmpty partEEECode and one with not IsEmpty partEECodes


            Portal.jpg

            • 3. Re: Portal filter calculation help
              DavidJondreau

              This calc:

              FaultLog::callDetailsReferenceNumber = Parts List::callDetailReferenceNumber

              should be your relationship, not in your portal filter. It's unclear what you're relationship is, but if you're using a cartesian, then portal filtering will be slow. If you're already using the above, then it's unnecessary in the filter.

               

              I like to use Let() to clarify things in plain English...

               

              Let ( [

              no.search =  IsEmpty(FaultLog::partsPortalSearch) ;

              search.match = PatternCount ( Parts List::partDescription ; FaultLog::partsPortalSearch)  ;

              no.code = IsEmpty ( Parts List::partEEECodes )  ;

              search.result = no.search or search.match ;

              show = search.result and no.code

              ];

              show

              )

              • 4. Re: Portal filter calculation help
                aetherington

                This is actually quite perfect,  As you said its a lot cleaner,  and you know what the result will be, I am looking into how my relationships are setup currently and hopefully will get this working today