Announcement

Collapse
No announcement yet.

How to determine if form is in insert or edit mode?

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

  • How to determine if form is in insert or edit mode?

    Hi,

    I need to do some conditional coding based on if a form is adding a new record or editing an existing record.

    There must be a variable somewhere that sets this, but the source code is somewhat confusing, and a lot of it is in Spanish, so it is hard to guess which one it might be.

    Thanks

    Tony

  • #2
    All is in the manual bro...


    Buttons
    sc_btn_copy
    This macro returns "true" when the "copy" button is selected in a form.
    sc_btn_delete
    This macro returns "true" when the "Delete" button is selected in a form.
    sc_btn_display ("Button_Name","on/off")
    This macro activate toolbars buttons on the application in execution time.
    sc_btn_insert
    This macro returns "true" when the "Add" button is selected in a form.
    sc_btn_new
    This macro returns "true" when the "Add New" button is selected in a form.
    sc_btn_update
    This macro returns "true" when the "Save" button is selected in a form.


    regards

    Comment


    • #3
      Thanks,

      It seems like a button property did not belong to what I was looking for and so it escaped me. However, as you said, it worked, especially after I sorted the logic out.

      Tony

      Comment


      • #4
        Glad to hear

        Regards

        Comment


        • #5
          So does "selected" mean that the button exist on the form and not that it's been selected/pressed?

          Comment


          • #6
            That is one of the reasons why it confused me at the start. But I used an if (sc_btn_new) statement to check to see if it did anything when in edit mode, and it bypassed the code in there, so it worked.

            Comment


            • #7
              Originally posted by robydago View Post
              So does "selected" mean that the button exist on the form and not that it's been selected/pressed?
              No it means it returns true when you've click on it

              Comment


              • #8
                About this question , it is possible to know in any event as like OnValidate the current mode of the form ? if a user is inserting or editing ?

                Example in onvalidate event, i need compare it.
                if (CURRENT_MODE = 'INSERT') then ....
                elseif (CURRENT_MODE = 'EDIT') then ....

                Comment


                • #9
                  Yes, with macros mentioned in this thread
                  /Giuseppe

                  Professional Scriptcase Services
                  Some Customers opinions

                  Comment

                  Working...
                  X