• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

API error encountered - Message after running Startup program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • API error encountered - Message after running Startup program

    I currently have a startup program that was created with the template provided for a NAB app. It seems like it is working and doing what I want, I just get this error in the snack bar at the bottom after it finishes.
    API error encountered: {myStartupProgram}
    I have no idea what that means or where to find out what it means. Any ideas on how to troubleshoot the issue?

  • #2
    Maybe try recompiling your start up program (assuming you just upgraded).
    If that is not the case or does not help, can you post the code in your startup program?

    Comment


    • #3
      I saw the release notes to recompile some RPG programs so I did that this morning.
      Here is the code for the startup program.

      Code:
      **Free
      /Include spchdrdft
      //================================================== ===========================================
      // Description..... Startup program for Annual training app
      //
      // 05/19/2021 KDR Program created
      // *End
      //================================================== ===========================================
      // Note To compile program: addlible VALENCE6 *last
      /define nabStartup
      /include qcpylesrc,vvNabTmpl
      
      //================================================== =======================
      // --------------------------------------------------------------
      // program start
      // --------------------------------------------------------------
      
      
      Initialize();
      Process();
      CleanUp();
      *inlr=*on;
      // --------------------------------------------------------------
      
      
      *InLR = *On;
      
      DCL-PROC process;
      DCL-PI *N;
      END-PI ;
      
      dcl-s div_char char(2);
      dcl-s div_num packed(2);
      dcl-s CurUser Char(10);
      
      
      
      exec sql set :curUser = session_user;
      
      Exec Sql delete from prwtrain where WKUSER = :curUser;
      
      exec sql Declare division Cursor for
      select AUDIVN from PRPUSERS
      where AUDIVN <> 0 and auuser = :curUser;
      exec sql open division;
      exec sql fetch division into :div_num;
      dow sqlcod = 0;
      
      div_char = %editc(div_num:'X');
      
      Exec sql insert into prwtrain
      ( select
      empn ,
      divn ,
      eename ,
      shift ,
      Shift_desc,
      trnc ,
      TRDESC ,
      dept ,
      deptd ,
      jobc ,
      jobd ,
      rtyp ,
      req_Type ,
      req_typ_dsc,
      req_ovr ,
      type ,
      req ,
      :CurUser
      from table(pr_train1(:div_char)) );
      
      exec sql fetch division into :div_num;
      Enddo;
      exec sql close division;
      
      
      End-Proc;
      DCL-PROC Initialize;
      DCL-PI *N;
      END-PI ;
      
      
      End-Proc;
      DCL-PROC CleanUp;
      DCL-PI *N;
      END-PI ;
      
      End-Proc;

      Comment


      • #4
        Looks like there is no positive response coming from your program, so the front-end is throwing up that generic error.

        Try putting vvOut_success() at the end of your process procedure.

        Comment


        • #5
          Update! Resolved.
          My startup program did not have the copy source at the bottom. So the procedures that were running were not the correct ones and that's why no response was being sent back to the front end which caused the generic error message.
          Sean got it figured out. Thank you.

          Comment


          • #6
            We resolved this over an online meeting. The program source was missing the include statement at the bottom:

            Code:
            /include qcpylesrc,vvNabTmpl
            And we removed the redundant Initialize and Cleanup prototype definitions.

            Comment

            Working...
            X