NetTalk Central

Author Topic: Restricting form access based on a value in the record  (Read 3794 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Restricting form access based on a value in the record
« on: December 07, 2008, 04:32:36 AM »
In my Clarion  application I place this code just before opening the window
IF SELF.Request=ChangeRecord OR SELF.Request=DeleteRecord
    IF QDTL:AutoCreate
        RETURN Level:Fatal
    END
END

I use this to restrict the user from changing or deleting records which have been created automatically.
How do I do the same thing in WebServer and which embed would I use?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Restricting form access based on a value in the record
« Reply #1 on: December 07, 2008, 04:40:35 PM »
You probably want to restrict it before you hit the form to reduce web pages served. Perhaps you could tell us more about what you're doing, but I'd probably hide or unhide a button based on a value. What are you trying to do exactly?
Mike Grigsby
Credify Systems
Central Oregon, USA

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Restricting form access based on a value in the record
« Reply #2 on: December 08, 2008, 08:51:22 AM »
I am writing a PABX configurator. Based on information captured to a file I automatically create certain child records in the system (which Server, which interface cards etc.) Since these records are based on calculations I don't want the user to be able to remove or change values in these specific records. As I create the records I mark the Autocreate field in the child file to TRUE. The user has the ability to add additional records (VOIP phones base stations etc.). So although I display all the autocreated and added records I don't want them to touch the auto stuff.
So yes code to hide the change and delete buttons when certain records that have the autocreate field set to TRUE is what I could use.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Restricting form access based on a value in the record
« Reply #3 on: December 08, 2008, 11:03:03 AM »
Hi Terry,

Assuming you've used "in-row" change and delete buttons, you can use the "conditional" on the form tab to make them conditional.

Cheers
Bruce