This topic is locked

No edit based on field value

11/12/2008 7:35:24 AM
PHPRunner General questions
buddy author

Can't seem to get this one to work.
Table: DataPath_Outsourcer

Field: Status
The data for this is pulled from a SQL server behind a firewall.
What I'm trying to do is if the Status field contains "Driver in CMS", this record should not be editable. Any other entry in this field should allow you to edit the record.
Some direction would be greatly appreciated.
Buddy

J
Jane 11/12/2008

Hi,
use List page: After record processed event on the Events tab to check value and show or hide edit link.

Here is a sample:

global $record;

if ($data["Status"]=="Driver in CMS")

{$record["edit_link"] = false;

}

else

{$record["edit_link"] = true;}

buddy author 11/12/2008

Perfect. Thank you.

buddy author 11/18/2008

Hi,

use List page: After record processed event on the Events tab to check value and show or hide edit link.

Here is a sample:


The above worked great. An extension to this is If the record contains "Requires Protocol" in the status field, I don't want the user to even see that record.
How can I modify the above to accomplish that?
Thanks. Your support is excellent.

J
Jane 11/18/2008

Hi,
edit SQL query on the Edit SQL query tab.

Here is a sample:

select field1,

field2,

...

from TableName

where Status!="Requires Protocol"