[progress Communities] [progress Openedge Abl] Eliminate Error 7254 And Allow All...

Status
Not open for further replies.
C

cverbiest

Guest
The code below may, or may not work depending on the implementation of RecordSelection:Id. If recordselection Id is a property with a default getter it will work. If the getter does some temp-table access it will fail with run-time error A FIND, FOR EACH or OPEN QUERY statement has been encountered in a user-defined function, method or constructor 'propGet_Id RecordSelection' which was called from a WHERE clause. This statement cannot be executed in this context. (7254) The implemenation of RecordSelection should be unknown to the developer, it is very hard to explain to a developer that the code she writes will fail because another developer chooses to change the implementation. The fact that there are temp-table accesses in RecordSelection could be hidden even further by using Collection objects which internally rely on temp-tables. define variable lRecord as RecordSelection no-undo. find first Customer no-lock. lRecord = new RecordSelection(). lRecord:Id = Customer.CustNum. find Customer where Customer.CustNum = lRecord:Id . /* File : RecordSelection.cls */ &scoped cause7254 true using Progress.Lang.*. block-level on error undo, throw. class RecordSelection: define temp-table t-id no-undo field Id as integer. define variable lId as integer no-undo. /** * Purpose: * Notes: * * @return character */ define public property Id as integer no-undo &if {&cause7254} &then public get(): find t-id. return t-id.Id. end get . public set(input iId as integer): find t-id no-error. if not available t-id then do: message "create t-id" view-as alert-box. create t-id. end. t-id.Id = iId. end set. &else get. set. &endif end class.

Continue reading...
 
Status
Not open for further replies.
Top