Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Programmatically Opening Record in SRP_Editor

Is there a way I can programmatically open a record in the SRP_Editor?


  • edited March 2018
    Dan - I moved the thread to the SRP Editor Tool rather than the SRP Editor Control. No doubt I'm now going to be quizzed as to why we have a category for the control...but I have my reasons. :)

    I thought for sure this was already posted and answered but I cannot find any threads that specifically discuss this. So...

    There is a dedicated program that you can call to launch the SRP Editor and auto-load an item. If the SRP Editor is already running it will load the item in that instance. You cannot load more than one item at a item but you can call this program multiple times. Here is the syntax:
    SRP_Editor_Open(Type, ID, LineNo)
    Here are the comments for this routine:
    * Parameters: 
    *   Type    [in] -- Must be: "Procedure", "Insert", "Record", or "DOS" (!!!CASE SENSITIVE!!!) 
    *   ID      [in] -- ID of the document to open. If "Procedure" or "Insert", ID must be an entity 
    *                   ID descriptor. If "Record", then ID<1> is the table name and ID<2> is the key. 
    *                   If "DOS", then ID is the full path and file name. 
    *   LineNo  [in] -- Optional line number to jump to when the file is opened 
    * Returns: 
    *   1 if successful, 0 if not.
  • I have been using this program to open records in the editor, but recently tried to open a procedure and I keep getting a popup with a big red circle with a white "X" in it that says "Open failed". Here is the code I am using to test it.

    rv = SRP_Editor_Open("Procedure", "NDW_MYFORM_EVENTS", ErrorLine)

    I get the same error popup with or without the ErrorLine variable in there. Is there a different way I am to name the procedure name/entity?
  • When opening a procedure or insert, you must pass the fully qualified Repository ID as the second parameter, i.e., "SYSPROG*STPROC**NDW_MYFORM_EVENTS"
  • Okay - thanks for the clarification!
Sign In or Register to comment.