This topic is locked
[SOLVED]

 Hide Link to Table if a given Field in emply

11/2/2013 4:14:58 PM
PHPRunner General questions
C
CWDATA author

I have a Table called "tblclicustomerdatabasecommissionsV2" the Index Field is "Land_Line_Billing_ID"
I have a link to a Child Table which is currently showing on the Master List Page next to each record.
I have a Field in the Master List which is displayed on the Master List page called "AccountNo".
What I want to do is to hide the link referred to above if the "AccountNo" Field is empty.
I have read a couple of previous postings but have been unable to get this to work.
Many thanks,
Carl.

C
cgphp 11/3/2013

In the "List page: After record processed" event, add this code:

if(empty($data['AccountNo']))

{

$record['yourdetailtablename_dtable_link'] = false;

}


Replace yourdetailtablename (but leave _dtable_link) with the real name of the details table.