Hi.
Here is an example of how to compile the Objects in an Import table. The use-case here is to call this after an import to compile just those Objects that were imported. This is just a quick example and may not be production quality. :)
/* Compile Objects in Import List after processing Intended to be run from the processImport event hook. Fields in rtbImport: FIELD wspace-id LIKE rtb.rtb_import.wspace-id LABEL "Workspace" FIELD src-wspace-id LIKE rtb.rtb_import.src-wspace-id LABEL "Source Workspace" FIELD product-id LIKE rtb.rtb_import.product-id FORMAT "x(50)" FIELD pmod LIKE rtb.rtb_import.pmod FORMAT "x(50)" FIELD obj-group LIKE rtb.rtb_import.obj-group FORMAT "x(80)" FIELD obj-type LIKE rtb.rtb_import.obj-type LABEL "Object Type" FIELD object LIKE rtb.rtb_import.object FORMAT "x(100)" FIELD version LIKE rtb.rtb_import.version FIELD module LIKE rtb.rtb_import.module FORMAT "x(50)" FIELD done LIKE rtb.rtb_import.done FIELD imp-action LIKE rtb.rtb_import.imp-action LABEL "Action" FIELD imp-status LIKE rtb.rtb_import.imp-status LABEL "Status" FIELD orphan LIKE rtb.rtb_import.orphan FIELD task-num LIKE rtb.rtb_import.task-num LABEL "Task" FIELD object-guid LIKE rtb.rtb_import.object-guid FIELD impUpdNotes AS CHARACTER FORMAT "x(255)" LABEL "Update Notes" FIELD impUserTaskRef AS CHARACTER FORMAT "x(50)" LABEL "User Ref" FIELD impTargetVersion AS INTEGER FORMAT "999999" LABEL "Target Version" FIELD impTargetProduct AS CHARACTER FORMAT "x(50)" LABEL "Target Product" FIELD impTargetPmod AS CHARACTER FORMAT "x(50)" LABEL "Target Pmod" FIELD impTargetModule AS CHARACTER FORMAT "x(50)" LABEL "Target Module" FIELD impTargetObjGroup AS CHARACTER FORMAT "x(8)" LABEL "Target Group" */ DEFINE VARIABLE cRowident AS CHARACTER NO-UNDO INITIAL "". DEFINE VARIABLE cWorkspace AS CHARACTER NO-UNDO INITIAL "test". /* get Workspace from processImport event */ DEFINE VARIABLE cError AS CHARACTER NO-UNDO. DEFINE VARIABLE cLog AS CHARACTER NO-UNDO. DEFINE VARIABLE hApi AS HANDLE NO-UNDO. {rtb/i/rtb_objtypes.i} DEFINE TEMP-TABLE rtbImport NO-UNDO {rtb/sdo/rtb_u_import.i} {rtb/admtwo/robjflds.i}. RUN rtb/proxy/p/rtbGetWorkspaceImports.p (INPUT-OUTPUT cRowident, 0, cWorkspace, OUTPUT TABLE rtbImport). /* Initialize API */ RUN rtb/p/rtb_api.p PERSISTENT SET hApi. RUN set_session_id IN hApi (DYNAMIC-FUNCTION('fnRtbGetCurrentSession')). RUN set_workspace_id IN hApi (cWorkspace). FOR EACH rtbImport NO-LOCK BY rtbImport.object: cError = "". IF (rtbImport.obj-type = {&PCODE} AND rtbImport.done) THEN DO: RUN compile_object IN hApi (rtbImport.pmod, rtbImport.obj-type, rtbImport.object, FALSE, FALSE, OUTPUT cError). IF cError <> "" THEN DO: cLog = ENTRY(2, cError, CHR(1)). DYNAMIC-FUNCTION('fnRtbAppendOSFile', cLog, DYNAMIC-FUNCTION('fnRtbPath', cLog) + "/importcompile.log"). END. END. END. RETURN. FINALLY: DELETE PROCEDURE hApi NO-ERROR. END FINALLY.