This topic is locked
[SOLVED]

Question on hiding buttons in Version 10.91

6/7/2025 9:11:11 AM
PHPRunner General questions
D
DealerModules authorDevClub member

Part of my PHPRunner Version 10.91 app is a time clock section.
How can I hide the "Clock In" and / or "Clock Out" buttons when there is already an entry for the fields.
So for example, on one of my records shown below, if the "Clock In" is already populated with a value, I want to hide the "Clock In" button on that record line so someone doesn't overwrite the existing.

Below is a screen shot to try to communicate what it looks like:

img alt

G
Grdimitris 6/7/2025

"Clock In" and "Clock Out" are custom buttons. Go to designer ann press the first button. In button properties you'll see the item id, next to rename there is a question mark "?". Click it and you see a help text. there is somthing like this
For elements in the data grid on the List and Print pages use $recordId parameter in the After record processed event:
$pageObject->hideItem("custom_button", $recordId);, where custom_button is the name of button. In your case instead of custom_button you'll have the name of the button. If you want you can rename it.
In the After record processed event add something like this
IF ($data['Clock_in']) $pageObject->hideItem("custom_button", $recordId);
The button for "Clock in" is named custom_button and the field is named Clock_in.
After clicking the button Assuming that you write the time to Clock_in field then in Client after event of button add this code

pageObj.toggleItem("custom_button", false, row.recordId() ); to hide the button

Do tha same for "Clock out" button.

D
DealerModules authorDevClub member 6/7/2025

Thanks Grdimitris.
I was able to getting it working with:
https://xlinesoft.com/phprunner/docs/how_to_control_inline_add_edit_functionality_from_script.htm

Thanks for your input.

Paul