This topic is locked
[SOLVED]

 Plausibility check / Lock detail tables

9/22/2019 2:23:41 AM
PHPRunner General questions
Karlo_from_Germany author

In my project there is a mastertable which contains several detail tables. Each entry in the master table is provided with a date in a field that saves the date of the entry. (add=()now)
A further field of the master table indicates the processing state of the data record, the value of this field can be:

  1. "open"
  2. "in progress"
  3. "completed"
    If the value of the field is "Completed", the date of the entry is set in another field of the mastertable.
    In the detailed tables, values are recorded with the respective current date of entry.
    I am looking for a solution to two questions:

  • If the value of the field is "completed", editing the detail tables should be prevented.
  • The date of the entries in the detail tables must not be earlier than the date of entry in the master table.
    Does anyone have any idea how to realize this?
    Thank you in advance!

Sergey Kornilov admin 9/23/2019

Something like this is possible. Check this Security API function that would allow you to turn off editing of any given table:

https://xlinesoft.com/phprunner/docs/secapi_set_permissions.htm
Also, you can use events like BeforeAdd/BeforeEdit to perform date values validation against the values in the master table. Use getMasterRecord() function to retrieve master record data:

https://xlinesoft.com/phprunner/docs/getmasterrecord.htm