This topic is locked

Add and Edit option dependent on record status

2/15/2009 9:43:01 AM
PHPRunner General questions
P
pbais author

Hi,
Can anyone help me with this one?
I have a table with records which all have a field 'editable'. The default is 'yes'. Let's say, for instance, the table contains records with commercial offering data for clients. Once the client has accepted the offer, the data may not be changed anymore, so the value for 'editable' will be set to 'no'.
All records of the table must be visible in the SAME list view for all authorized users, but the 'add', 'edit' or 'select' (checkbox) options may NOT be available for records with 'editable' value = 'no'.
How do I ahieve this?
Thnx.

J
Jane 2/16/2009

Hi,
you need to check field value and hide edit link and checkbox if needed in the List page: After record processed event on the Events tab.

Here is a sample:

global $record;

if ($data["FieldName"]=="no")

{

$record["edit_link"] = false;

$record["checkbox"] = false;

}