Load the browse empty or full with data?

Is there s simple way the browse screen will either load empty or full with data (according to some parameter)?

If load empty then filtered locator will be used to show subset of data.

ABC, standard browse, sql database

I haven’t tried this…
But How about something like this.

DerivedBrowseClass            CLASS(BrowseClass)!.....
ForceEmpty                       BOOL
DerivedBrowseClass.ResetQueue    PROCEDURE(BYTE RefreshMode),DERIVED
                              END 

DerivedBrowseClass.ResetQueue PROCEDURE(BYTE RefreshMode)
   CODE
   IF SELF.ForceEmpty
      SELF.LoadPending = 1
      RETURN
   END 
   PARENT.ResetQueue( RefreshMode )

For empty, set filter to 1=0 based on parameter. Otherwise, load full with data.

thanks, good idea…

Mark, but it can be applied to standard Clarion ABC Browse?

Clarion_Clarion, I was talking about a standard Clarion ABC Browse

The way that embeds work, is you derive the base class
If it’s hard to add a property to the derived class (note: I don’t use APPs - hand code only)
Then just create a procedure level variable, and use side-effect

Mark,

I found that I can use code below directly in standard browse

in ResetQueue before Parent Call:

  IF MyCondition
    RETURN
  END

But the problem is when I have Locators fields. It became disabled.

I need to have it (Locator) enabled so I can type something and my Browse will be loading. After that, I need to turn MyCondition OFF so browse will continue loading data. Not sure how to do this.

In your Browse UpdateWindow method after the parent call:

    IF  <your condition> and RECORDS(SELF.Q) = 0
        IF ~SELF.Sort.Locator &= NULL
          SELF.Sort.Locator.SetEnabled(true)
        END
    END
1 Like

Thank you, Rick, will give it a try