Consultor Eletrônico



Kbase P43542: How To Filter By Company In Dynamics
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How To Filter By Company In Dynamics

FIX:

Code an override of the initializeObject procedure of the sdo to get the company_obj and then use this property to build the required query.

Thus:
DEFINE VARIABLE cProperties AS CHARACTER NO-UNDO.
DEFINE VARIABLE dCompanyObj AS DECIMAL NO-UNDO.
{set OpenOnInit NO}.
ASSIGN cProperties = DYNAMIC-FUNCTION ('getPropertyList' IN gshSessionManager,
'currentOrganisationObj', NO)
dCompanyObj = DECIMAL(cProperties).
/* Gets the obj value of the current company the user has logged into */

DYNAMIC-FUNCTION('assignQuerySelection' IN TARGET-PROCEDURE,
"login_company_obj", dCompanyObj, "").
DYNAMIC-FUNCTION("openQuery" IN TARGET-PROCEDURE).
RUN SUPER.
/* Adds the company obj to the query and opens the query */