Consultor Eletrônico



Kbase P82213: How to use The RunAttribute property.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/06/2004
Status: Unverified

GOAL:

How to use The RunAttribute property.

FACT(s) (Environment):

Dynamics 2.1A

FIX:

The RunAttribute property maps to attributes set up in the gsc_instance_attribute table in the Dynamics Repository. Use this property to change the behavior of generic objects. For example, If you have a generic object that you want to behave differently for a creditors system and a debtors system. you can use this property to determine the functionality for the specific instance of the generic object. That is, is the object being used in the creditors system or the debtors system.

For example you could use this property set against a container to affect the filter of an SDO in the SDO logic procedure. e.g.

PROCEDURE initializeObject :
DEFINE VARIABLE hContainerHandle AS HANDLE NO-UNDO.

{get ContainerSource hContainerHandle}.

IF VALID-HANDLE(hContainerHandle) THEN
cRunAttribute = DYNAMIC-FUNCTION('getRunAttribute' IN
hContainerHandle) NO-ERROR.

IF cRunAttribute = "CREDIT" THEN
DO:
DYNAMIC-FUNCTION("setQueryWhere":U IN TARGET-PROCEDURE,
<Credit where clause>).
END.
ELSE
DO:
DYNAMIC-FUNCTION("setQueryWhere":U IN TARGET-PROCEDURE,
<Debit where clause>).
END.

RUN SUPER.
END PROCEDURE.