No announcement yet.

How to differentiate form mode

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to differentiate form mode


    I have created basic forms from available SQl file. My requirement is how do i differentiate the form "Mode" so that i can decide on my logic.

    1. A user should not be able to modify entries by other user
    2. If a "Add New" button is clicked, then it is a new entry. How do i know this difference.....that is form opened for viewing and form opened for new entry

    Hope my question is clear. It may be simpler but i'm in need of help


  • #2
    1.- Then you must to add your logic on onBeforeUpdate checking if active user was who created the record, and allow or deny.
    2.- Right now I don't know if exists a way to do it via variables or macros, I didn't needed, but, like always I did....

    PHP Code:
    if ({idField}>0
    //new record 

    Professional Scriptcase Services
    Some Customers opinions


    • #3
      1. You need to keep track of the owner of the record. So you need to store the userid into the record and use the onrecord event to show the user if the record is editable. In the onvalidate or onbeforeupdate you check if the user is allowed.
      2.Look at the macro's, there's a macro to find out which button (insert/update) was clicked. You use that in the onvalidate event.
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development /


      • #4
        If you have setup your data dictionary you can go there and open the tables one by one. With cut and paste you can retrieve a lot of the field names. If you don't have that you need to go to applications you have created (if any...) then you can go to the sql section and extract the fieldnames from there. Otherwise I dunno I'm affraid.
        We provide 299-01 dumps to pass certkiller gmat with online exam wikipedia itil and Cornell University you can also get best quality PMI along with selftestengine mcat for your guaranteed Intel