This topic is locked
[SOLVED]

Hide ADD button in list page but not while detail/child

4/21/2022 6:14:30 PM
PHPRunner General questions
P
ppradhan@live.com author

Hi all,
Is there a way to apply trick like this?

Need to hide the 'Add New' button in the list page (to avoid user to add record from the list page). But same 'Add New' button should appear in the list page when it acts as a detail/child record. I mean Add button should be visible only when it is a detail (with Master/Detail relation applied).
Please advice if this is applicable.

with regards

C
copper21 4/21/2022

Try This: Put code into list page of child->Before Display in events

//Hide Add Button If Not Part Of Master Record

$data = $pageObject->getMasterRecord();

if($data)
{
$pageObject->showItem("add");
}
else
{
$pageObject->hideItem("add");
}
P
ppradhan@live.com author 4/22/2022

@copper21,
many thanks bro, it is exactly what I was looking for. Appreciate your great tips.