limiting browse based on login?

Tom Aldridge toma at aldridgeinc.com
Thu Sep 3 08:07:00 PDT 2009


scooter6 at gmail.com wrote:
 >   Can someone point me in the direction of using qualifiers?
 >   I'm a little vague on how I would set that up.

Ok, don't hold me to every little detail here but here's an overview of 
how I might do things:

Create the client qualifier via define files. Let's say it's named 
"c1234". Others on this list probably can point a way to build the 
qualifer on the fly vs define files.

Create a "stand" file to work out of. Create a processing table 
"client". Name these whatever you want.

Have the client run: /appl/fp/rclerk stand -sclientscrn -z client -xa 
-bx -d -h "Client View"

In the table, among other stuff do:

@update
gosub delc (check to see if exists and/or delete any records in the 
c1234 qualifier)
gosub bldc (copy the records from the main file to the qualifier (c1234)
Now put up your browse.
When the client exits, have it delete the records they're sitting on 
because remember you are in a stand file and don't want to create a 
bunch of useless records there.

Here are the subroutines cobbled together so don't hold me to every bit 
here:

582  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
delc. If:    			 'see if there are records in the qualifier for this 
client    .                                                               .
        Then: lookup dclients = ("crecords@"{client_no)  k=("")  i=D -ng
583  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
dloop  . If: not dclients 
           .
        Then: return
584  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: delete dclients; getnext dclients; goto dloop
585  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: end 
         .
586  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
bldc. If: 
     .
        Then: 
         .
587  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: lookup client = mainclientfile  k=("clientno") i=C -nx.
588  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: not client 
           .
        Then: beep; errorbox "Unable to find client records to build 
qualifed file with."; delete; exit
589  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
cloop. If: client(23) ne "client_no"                                       .
        Then: return 
         .
590  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: lookup fcliqual = ("mainclientfile@"{client_no) r=free  -e 
                .
591  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: not fcliqual
        Then: beep; errorbox "Unable to allocate free record for client 
qualifer."
592  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: copy fcliqual 
          .
593  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: getnext client; goto cloop 
         .
594  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
        . If: 
         .
        Then: end 
         .

Tom Aldridge


More information about the Filepro-list mailing list