Browse query

Hi,

I am seeking some help to solve this problem. Browse has a table called contract and I have a program consecur.i to check contract records to see if the user has access or not. Usercont table contain access, range from and range to. e.g. Access: Yes code from: AAA To: ZZZ
Access: No code from: Dave To: Dave
They are stored in temp table called tt-security. It stops working when the contract does not meet the ranges in tt-security table. Is there any way of carrying on checking other contracts after return error. If return error, it will not display the specified contract in the browse which is correct but wont check further contracts.

Here is the code snippet.

ON FIND OF Contract override DO:

IF contract.con-code = ""
THEN
RETURN.

ASSIGN v-constring = contract.con-code.

IF NOT CAN-FIND (FIRST tt-security
WHERE tt-security.tt-access
AND tt-security.tt-from <= v-constring
AND tt-security.tt-to >= v-constring)
OR CAN-FIND (FIRST tt-security
WHERE NOT tt-security.tt-access
AND tt-security.tt-from <= v-constring
AND tt-security.tt-to >= v-constring)
THEN
RETURN ERROR.

END.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Solution P94261?

Maybe solution P94261 of the Knowledge Center will answer your question.


a comment from Progress doc: don't use FIND triggers

From the 4GL Handbook (10.1A):
"Generally, you should not use FIND
triggers. They are expensive—consider that you are executing a compiled procedure for
every single record read from that table anywhere in your application. Also, they are
typically used for security to provide a base level of filtering of records that the user should
never see. For various reasons, including the fact that a CAN-FIND function does not
execute the FIND trigger, this security mechanism is not terribly reliable. You are better off
building a general-purpose filtering mechanism into your application architecture in a way
that is appropriate for your application, rather than relying on the FIND trigger to enforce it."