Question Run command from the AppBuilder

Hi everyone,

Do you what instruction is USED by the appbuilder to run the program your currently working on ?

Iike
run mypgm as persistent


Best regards ,

BobyIsProgress
 

Osborne

Active Member
Do you want to know how to run directly from the AppBuilder or if the AppBuilder is running the program as persistent?

The attached image shows how to run from the AppBuilder and what to set if you want to run as persistent or not.
 

Attachments

I know how to run it from the app builder.
But I was looking for what was the command the appbuilder use.
I will check on what you show me
 

Osborne

Active Member
I see. I am not sure if that is documented anywhere.

The manual says this which indicates it may be similar to running from the Procedure Editor:
At any time during an AppBuilder session, you can test the current design window workspace. When you run a design window, you are in fact running a temporary procedure file. If you read a procedure file into AppBuilder and make changes to the design window, the temporary file reflects those changes. However, until you save the procedure file, AppBuilder does not store the changes permanently. When you save your changes, AppBuilder overwrites the procedure file and preserves the changes. If you prefer to preserve the original state, do a Save As instead, or discard your changes by exiting without saving.

To run a design window, choose CompileRun, click Run, or press F2. Running the design window hides all windows except AppBuilder’s main window, and disables all of AppBuilder’s functionality except for a Stop button. AppBuilder displays the Stop button (eight-sided, red; it resembles the US “STOP” traffic sign) in place of the Run button.
You may find answers in the AppBuilder source code:
 
The reason I asked this is because I developp a program that don't have the sames starting behavior if I launch it from the app builder or from our ERP menu . So I was thinking that there was a difference in the run procedure .

I run a pro spy plus to compare what was going on with the two method and no differrence .

The thing is I had wrote this :
Code:
/* ***************************  Main Block  *************************** */
MESSAGE 1
    VIEW-AS ALERT-BOX INFO BUTTONS OK.
/* Include custom  Main Block code for SmartWindows. */
{adm/template/windowmn.i}

DEFINE VARIABLE cmpt  AS INTEGER     NO-UNDO.
DEFINE VARIABLE myColumn AS HANDLE   NO-UNDO.

MESSAGE 2
    VIEW-AS ALERT-BOX INFO BUTTONS OK.

DO cmpt = 4 TO brFAM:NUM-COLUMNS :
    myColumn = brFam:GET-BROWSE-COLUMN(cmpt) .
    ON LEAVE OF myColumn
    DO:
        DEFINE VARIABLE colAdrr  AS INTEGER     NO-UNDO.
        DEFINE VARIABLE ordout AS INTEGER     NO-UNDO.
      
        ASSIGN
            ordout  = BUFFAM::ordout
            colAdrr = INTEGER(SUBSTRING(SELF:NAME,4)) .

        /* vérification du changement de donnée dans la cellule pour ne pas déclencher le trigger pour rien */
        IF SELF:SCREEN-VALUE = BUFFAM::outval(colAdrr) THEN RETURN.

        RUN 99-triggeredBrowse(ordout,colAdrr) .
        RETURN.
    END.
    ON 'RETURN':U OF myColumn
    DO:     
        DEFINE VARIABLE colAdrr  AS INTEGER     NO-UNDO.
        DEFINE VARIABLE ordout AS INTEGER     NO-UNDO.
        
        ASSIGN
            ordout  = BUFFAM::ordout
            colAdrr = INTEGER(SUBSTRING(SELF:NAME,4)) .
         /* vérification du changement de donnée dans la cellule pour ne pas déclencher le trigger pour rien */
        IF SELF:SCREEN-VALUE = BUFFAM::outval(colAdrr) THEN RETURN.
        
        RUN 99-triggeredBrowse(ordout,colAdrr) .

        RETURN.
    END.
END.
/************************************* END MAIN BLOCK ************************************/


/*------------------------------------------------------------------------------
  Purpose:     Override standard ADM method
  Notes:       
------------------------------------------------------------------------------*/
MESSAGE 3
    VIEW-AS ALERT-BOX INFO BUTTONS OK.
  /* Code placed here will execute PRIOR to standard behavior. */
  RUN silver-get-attribute IN silver-broker-hdl ("stecod":U).
  ASSIGN c-stecod = RETURN-VALUE.
  RUN silver-get-attribute IN silver-broker-hdl ("uticod":U).
  ASSIGN c-uticod = RETURN-VALUE.
 
  /* Dispatch standard ADM method.                             */
  RUN dispatch IN THIS-PROCEDURE ( INPUT 'initialize':U ) .

  /* Code placed here will execute AFTER standard behavior.    */
  ASSIGN
      W-Win:WIDTH  = 114.29
      W-Win:HEIGHT = 23.08
      profondeur = 15
      myInfo = FI-Info:HANDLE IN FRAME F-Main
      brFam  = BR-FAM:HANDLE.
 
  CURRENT-WINDOW:WINDOW-STATE = WINDOW-NORMAL .
  APPLY "WINDOW-RESIZED":U TO W-Win.

  myInfo:SCREEN-VALUE = "Récupération des semaines" .
  RUN 01-prc-getWeek . /* récupération des semaines selon la profondeur */
  IF NUM-ENTRIES(RETURN-VALUE,"|":U) > 1 THEN DO:
      MESSAGE ENTRY(1,RETURN-VALUE,"|":U) SKIP
              ENTRY(2,RETURN-VALUE,"|":U)
          VIEW-AS ALERT-BOX ERROR BUTTONS OK.
      RETURN.
  END.

  myInfo:SCREEN-VALUE = "Récupération données PIC" .
  RUN 02-prc-getPIC . /* récupération des données du PIC */
  IF RETURN-VALUE <> "":U THEN DO:
      MESSAGE RETURN-VALUE
          VIEW-AS ALERT-BOX INFO BUTTONS OK.
  END.
 
  myInfo:SCREEN-VALUE = "Récupération des encours de commandes" .
  RUN 03-getStoenc . /* Récupération des encours de commandes */
 
  myInfo:SCREEN-VALUE = "Mise à jour des données sur les références" .
  RUN 04-prc-majTTREF . /* Mise à jour de la table produit */
 
  myInfo:SCREEN-VALUE = "Calcul du PDP" .
  RUN 05-prc-CalculProd .
 
  myInfo:SCREEN-VALUE = "Préparation de l'affichage des refs" . 
  RUN 06-prc-FormatingRef .
    
  myInfo:SCREEN-VALUE = "Mise en forme des Sous FAM".
  RUN 07-prc-FormatingFam .

  myInfo:SCREEN-VALUE = "Récupération des ratios".
  RUN 08-prc-compilationRatio .

  myInfo:SCREEN-VALUE = "Génération des couleurs" .
  RUN 09-prc-geneColor.
    
  myInfo:SCREEN-VALUE = "Terminée" .
    dispQueryFam:QUERY-OPEN() .
    brFam:SELECT-FOCUSED-ROW() .
    APPLY "VALUE-CHANGED":U TO brFam .
    
  
  /* Subrsciption to the function */
    SUBSCRIBE TO "SendAway":U ANYWHERE RUN-PROCEDURE "99-prc-FromFarAway":U .

END PROCEDURE.

/*************************** fin local-initialize ***********************************/
At launch with the app builde I had the following message :
1
3
2

But launch with our menu I have this :
1
2
3

So the issue for me was that the brFam wasn't setup and had handle error message .

I manage to do it by move all I was needed at the begining of the handle :
Code:
/* ***************************  Main Block  *************************** */
DEFINE VARIABLE cmpt     AS INTEGER     NO-UNDO.
DEFINE VARIABLE myColumn AS HANDLE      NO-UNDO.
DEFINE VARIABLE myField  AS HANDLE      NO-UNDO.

ASSIGN
    profondeur = 15
    myInfo = FI-Info:HANDLE
    brFam  = BR-FAM:HANDLE .

CREATE TEMP-TABLE TTFAM.
TTFAM:ADD-NEW-FIELD("logfamcod":U,"CHARACTER":U,0,"X(10)").
TTFAM:ADD-NEW-FIELD("logfascod":U,"CHARACTER":U,0,"X(10)").
TTFAM:ADD-NEW-FIELD("nbjcouv":U,"INTEGER":U).
TTFAM:ADD-NEW-FIELD("nbjouvr":U,"INTEGER":U).
TTFAM:ADD-NEW-FIELD("ini":U,"CHARACTER":U).
TTFAM:ADD-NEW-FIELD("couleur":U,"INTEGER":U).
TTFAM:ADD-NEW-FIELD("ordout":U,"INTEGER":U).
TTFAM:ADD-NEW-FIELD("labelout":U,"CHARACTER":U,0,"X(10)").
TTFAM:ADD-NEW-FIELD("outval":U,"INTEGER":U,profondeur,"->>>>>>>>9":U) .
TTFAM:ADD-NEW-INDEX("I01":U,TRUE,TRUE).
TTFAM:ADD-INDEX-FIELD("I01":U,"logfamcod":U).
TTFAM:ADD-INDEX-FIELD("I01":U,"logfascod":U).
TTFAM:ADD-INDEX-FIELD("I01":U,"ordout":U).
TTFAM:TEMP-TABLE-PREPARE("TTFAM":U) .

CREATE BUFFER BUFFAM FOR TABLE TTFAM .

CREATE QUERY dispQueryFam.
dispQueryFam:SET-BUFFERS(BUFFAM) .
dispQueryFam:QUERY-PREPARE("FOR EACH TTFAM NO-LOCK":U) .

ASSIGN 
    brFam:QUERY     = dispQueryFam
    brFam:READ-ONLY = FALSE
    myColumn        = brFam:ADD-LIKE-COLUMN("TTFAM.labelout":U)
    myColumn:LABEL  = "Type"
    myColumn:WIDTH-PIXELS = func-widthcolumn(myColumn) + 50
    myColumn        = brFam:ADD-LIKE-COLUMN("TTFAM.logfamcod":U)
    myColumn:LABEL  = "Famille"
    myColumn:WIDTH-PIXELS = func-widthcolumn(myColumn)
    myColumn        = brFam:ADD-LIKE-COLUMN("TTFAM.logfascod":U)
    myColumn:LABEL  = "Sous Famille"
    myColumn:WIDTH-PIXELS = func-widthcolumn(myColumn)
    myColumn        = brFam:ADD-LIKE-COLUMN("TTFAM.ini":U)
    myColumn:LABEL  = STRING(TODAY)
    myColumn:WIDTH-PIXELS = func-widthcolumn(myColumn)
    myField         = BUFFAM:BUFFER-FIELD("outval":U):HANDLE
    myColumn        = brFam:ADD-LIKE-COLUMN(myField)
    myColumn:READ-ONLY = FALSE
    myColumn:FONT   = 2
    cmpt = 5
    brFam:NUM-LOCKED-COLUMN = 3 .

myInfo:SCREEN-VALUE = "Récupération des semaines" .
RUN 01-prc-getWeek . /* récupération des semaines selon la profondeur */
IF NUM-ENTRIES(RETURN-VALUE,"|":U) > 1 THEN DO:
  MESSAGE ENTRY(1,RETURN-VALUE,"|":U) SKIP
          ENTRY(2,RETURN-VALUE,"|":U)
      VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  RETURN.
END.

FOR EACH TTWEEK NO-LOCK : /* renomage des colonnes en fonction de la semaine */
    ASSIGN
        myColumn              = brFam:GET-BROWSE-COLUMN(cmpt)
        myColumn:NAME         = "COL":U + STRING(cmpt - 4)
        myColumn:LABEL        = STRING(TTWEEK.weekann) + " - ":U + STRING(TTWEEK.weeknum)
        myColumn:WIDTH-PIXELS = func-widthcolumn(myColumn) + 30
        myColumn:COLUMN-FONT  = 2
        myColumn:READ-ONLY    = FALSE
        cmpt                  = cmpt + 1.
        
END.

/* récupération des colonnes pour mise en forme dans le row-display */
ASSIGN
    cmpt = 1
    myColumn = brFam:GET-BROWSE-COLUMN(cmpt) .

DO WHILE VALID-HANDLE(myColumn) :
    CREATE TTCOLFAM.
    ASSIGN
        TTCOLFAM.myCol = myColumn:HANDLE
        cmpt = cmpt + 1
        myColumn = brFam:GET-BROWSE-COLUMN(cmpt) NO-ERROR.

END.

DO cmpt = 4 TO brFAM:NUM-COLUMNS :
    myColumn = brFam:GET-BROWSE-COLUMN(cmpt) .
    ON LEAVE OF myColumn
    DO:
        DEFINE VARIABLE colAdrr  AS INTEGER     NO-UNDO.
        DEFINE VARIABLE ordout AS INTEGER     NO-UNDO.
      
        ASSIGN
            ordout  = BUFFAM::ordout
            colAdrr = INTEGER(SUBSTRING(SELF:NAME,4)) .

        /* vérification du changement de donnée dans la cellule pour ne pas déclencher le trigger pour rien */
        IF SELF:SCREEN-VALUE = BUFFAM::outval(colAdrr) THEN RETURN.

        RUN 99-triggeredBrowse(ordout,colAdrr) .
        RETURN.
    END.
    ON 'RETURN':U OF myColumn
    DO:     
        DEFINE VARIABLE colAdrr  AS INTEGER     NO-UNDO.
        DEFINE VARIABLE ordout AS INTEGER     NO-UNDO.
        
        ASSIGN
            ordout  = BUFFAM::ordout
            colAdrr = INTEGER(SUBSTRING(SELF:NAME,4)) .
         /* vérification du changement de donnée dans la cellule pour ne pas déclencher le trigger pour rien */
        IF SELF:SCREEN-VALUE = BUFFAM::outval(colAdrr) THEN RETURN.
        
        RUN 99-triggeredBrowse(ordout,colAdrr) .

        RETURN.
    END.
END.

/* Include custom  Main Block code for SmartWindows. */
{adm/template/windowmn.i}
Best Regards ,

BobyIsProgress
 
Top