Hi All
Is it possible to archive records in a data base? I track the stages of jobs throughout the period of making them. Once them are made I make them inactive so I can sore them out. I would like to archive so them so they are never part of any search unless I want them to be.
Thanks
Archiving records
Re: Archiving records
Hi there.
Not sure if I understand exactly what you need, but assume you don't want archived records to show up on any search?
your_table should include a include a tiny_int checkbox, caption 'is_archived' or similar.
the go to hooks/your_table.php, find your_table_init() hook, and replace the entire function with:
Obviously, if you already have something in init() hook, you should leave it in there as well and remember to replace 'your_table' with your actual table name.
Not sure if I understand exactly what you need, but assume you don't want archived records to show up on any search?
your_table should include a include a tiny_int checkbox, caption 'is_archived' or similar.
the go to hooks/your_table.php, find your_table_init() hook, and replace the entire function with:
Code: Select all
function sales_init(&$options, $memberInfo, &$args) {
$archiveFilter = "`your_table`.`is_archived` = 0";
if(trim($options->QueryWhere ?? '') !== '') {
$options->QueryWhere = "({$options->QueryWhere}) AND {$archiveFilter}";
} else {
$options->QueryWhere = $archiveFilter;
}
return true;
}SignGini: add a digital signature with full audit history and embedded security features to a table
FieldGuard: extend AppGini Permissions by making selected fields with sensitive information hidden or read only at runtime for individual members. Also works on filters, csv, print-preview.
GuestLink: create a secure one-time email link for a user without the need for a username and password. Great for surveys, sign-offs, etc.
FieldGuard: extend AppGini Permissions by making selected fields with sensitive information hidden or read only at runtime for individual members. Also works on filters, csv, print-preview.
GuestLink: create a secure one-time email link for a user without the need for a username and password. Great for surveys, sign-offs, etc.
Re: Archiving records: EDIT
i didn't do a very good job of editing the code!
replace
function sales_init(&$options, $memberInfo, &$args)
with
function your_table_init(&$options, $memberInfo, &$args)
where your_table is the name of your actual table.
replace
function sales_init(&$options, $memberInfo, &$args)
with
function your_table_init(&$options, $memberInfo, &$args)
where your_table is the name of your actual table.
SignGini: add a digital signature with full audit history and embedded security features to a table
FieldGuard: extend AppGini Permissions by making selected fields with sensitive information hidden or read only at runtime for individual members. Also works on filters, csv, print-preview.
GuestLink: create a secure one-time email link for a user without the need for a username and password. Great for surveys, sign-offs, etc.
FieldGuard: extend AppGini Permissions by making selected fields with sensitive information hidden or read only at runtime for individual members. Also works on filters, csv, print-preview.
GuestLink: create a secure one-time email link for a user without the need for a username and password. Great for surveys, sign-offs, etc.