Blogs
October
Greetings from Urdhva Tech!
Thank you to people submitting "how to topics".
Q: How to make a field mandatory only if creating a record?
Lets do this,
For example lets make "Office phone" required in Accounts module.
Step 1: Create / Edit (if exists at modules/Accounts/views/view.edit.php, copy over) custom/modules/Accounts/views/view.edit.php
And have following code in function display.
function display() { |
Voila! Done!.
[Loved how screen looks than what you have? Buy the look!]
Highlight:
if(empty($this->bean->fetched_row['id'])) is the key! Do something ONLY for new records!
Hope that helps! Post comment below.
Keep posting how-to topics! Excited to start off with first how to on request!
Related: Required conditionally if dropdown X has value Y.
Comments
- No Comments Found.