Using DoFunction with OnBeforeTransaction

 2 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Nick
Veteran Member
Posts: 50
Veteran Member

    I have a customized PA49 form with 2 new text fields (not tied to the database) that I am trying to concatenate into one field tied to the database.  I am using an OnBeforeTransaction to get the values and then write to the standard field.  That part is working fine.  However, I am having trouble getting a lawformDoFunction call to then perform the original transaction that the user requested.  I am getting a result where either the user has to click the Add/Change button again, or it appears to get stuck in a loop trying to perform the action repeatedly.

    Does anyone have any ideas on the syntax to use to 'hijack' a funtion code, set a field value, and then perform the function code? 

    Thanks!

    Nick

    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      If you add Return True; to the end of your function then the script should return control back to the form and the transaction (whichever button was clicked) should execute. You shouldn't have to add the do function call.
      David Williams
      Gary Davies
      Veteran Member
      Posts: 248
      Veteran Member

        I am trying to understand why you need to use the DoFunction. You just need to merge the fields in OnBeforeTransaction if the FC is "A" or "C" (as you are doing) and split and populate the fields in OnAfterTransaction if the FC is I,N or P.

        You should only use DoFunction when you want to "simulate" pressing a function code when the actual user has not pressed one.