Hi.
Below is a code sample I just wrote to test something and thought I would share with the community. Enjoy. :)
/* Get Workspaces, fetch the first one, and get its Tasks using the proxies. */ DEFINE VARIABLE cAs AS CHARACTER NO-UNDO. DEFINE VARIABLE cError AS CHARACTER NO-UNDO INITIAL "". DEFINE VARIABLE cRowident AS CHARACTER NO-UNDO INITIAL "FIRST". DEFINE VARIABLE hAs AS HANDLE NO-UNDO. DEFINE VARIABLE hWsBuf AS HANDLE NO-UNDO. DEFINE VARIABLE hWsTT AS HANDLE NO-UNDO. DEFINE VARIABLE hTaskBuf AS HANDLE NO-UNDO. DEFINE VARIABLE hTaskTT AS HANDLE NO-UNDO. DEFINE VARIABLE hTaskQry AS HANDLE NO-UNDO. DEFINE VARIABLE iSid AS INTEGER NO-UNDO INITIAL 0. cAs = "-AppService win115 -H wintest -S 5163". CREATE SERVER hAs. hAs:CONNECT(cAs). RUN rtbSessionLogin.p ON hAs (INPUT "sysop", /* user */ "", /* pass */ OUTPUT iSid, OUTPUT cError). IF cError <> "" THEN UNDO, THROW NEW PROGRESS.Lang.AppError (cError). RUN rtbGetWorkspaces.p ON hAs (INPUT-OUTPUT cRowident, INPUT 0, INPUT TRUE, /* include hidden? */ OUTPUT TABLE-HANDLE hWsTT). hWsBuf = hWsTT:DEFAULT-BUFFER-HANDLE. hWsBuf:FIND-FIRST("where wspace-id = 'devel'"). cRowident = "FIRST". RUN rtbGetTasks.p ON hAs (INPUT-OUTPUT cRowident, INPUT 0, INPUT hWsBuf::wspace-id, /* workspace */ INPUT "", /* user */ INPUT TRUE, /* completed tasks? */ OUTPUT TABLE-HANDLE hTaskTT). hTaskBuf = hTaskTT:DEFAULT-BUFFER-HANDLE. CREATE QUERY hTaskQry. hTaskQry:SET-BUFFERS(hTaskBuf). hTaskQry:QUERY-PREPARE("for each " + hTaskTT:NAME). hTaskQry:QUERY-OPEN(). DISPLAY hWsBuf::wspace-id FORMAT "x(30)" SKIP hWsBuf::DESCRIPTION FORMAT "x(60)" SKIP hWsBuf::wspace-path FORMAT "x(60)" SKIP WITH FRAME A TITLE "Workspace Details". hTaskQry:GET-FIRST(). DO WHILE NOT hTaskQry:QUERY-OFF-END: DISPLAY hTaskBuf::task-num hTaskBuf::SUMMARY FORMAT "x(60)" SKIP WITH FRAME B TITLE "Workspace Tasks" DOWN. DOWN WITH FRAME B. hTaskQry:GET-NEXT(). END. RUN rtbSessionLogout.p ON hAs (INPUT iSid, OUTPUT cError). IF cError <> "" THEN UNDO, THROW NEW PROGRESS.Lang.AppError (cError). CATCH e AS PROGRESS.Lang.AppError: MESSAGE e:ReturnValue VIEW-AS ALERT-BOX. DELETE OBJECT e. END CATCH. FINALLY: hAs:DISCONNECT(). DELETE OBJECT hAs NO-ERROR. DELETE OBJECT hWsTT NO-ERROR. DELETE OBJECT hTaskTT NO-ERROR. DELETE OBJECT hTaskQry NO-ERROR. END.
Great, thanks.