The dropdown of the "TaxRate" field does not show from the product's edit view

Good morning,

It suddenly happens and the fields in the product edit view layout disappear. When we press “Repair and Rebuild”, they start appearing again.

Server Configuration PHP 8.2
SuiteCRM Current Version: 7.14.6 (Upgrade from 7.13.2 to 7.14.4 and 7.14.4 to 7.14.6)

Thanks
Asif Khalyani

Did you add those custom fields?

@rsp Yes, it’s a custom field in the main table.

The file path of the field: custom/Extension/modules/AOS_Products/Ext/Vardefs/custom_db_field.php

<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

$dictionary["AOS_Products"]["fields"]['tax_rate'] = array(
    'name' => 'tax_rate',
    'vname' => 'LBL_TAX_RATE',
    'type' => 'enum',
    'options' => 'tax_rate_list',
    'len' => 255,
    'massupdate' => false,
    'audited' => true,
    'inline_edit' => false,
);

I do not know the reason of disappearing the fields, but when you add custom fields in the code; you already need to run QR&R.

@rsp

Yes, when I repair and rebuild the fields appear but for some reason the fields are missing from the edit view, then when I repair and rebuild they come back

Why do fields disappear repeatedly?

Check if you can see this field in the layouts

Admin → Studio → Products → Layouts

Check edit and detail view layouts!

Hi @offshoreevolution, have you already checked for permission in your instance?
What kind of permission settings are you using in your config.php or config_override.php file?

Hi @LionSolution

Yes, its permission is okay. Because the field is displaying but something went wrong and its disapearing.

I think the issue with the below repair & rebuild code. It is running from the scheduler and add & remove field from layout.

$autoexecute = false; //execute the SQL
            $show_output = false; //output to the screen
            require_once("modules/Administration/QuickRepairAndRebuild.php");
            $ranc = new RepairAndClear();
            $ranc->repairAndClearAll(array('clearAll'),array('AOS_Products'), $autoexecute, $show_output);

cc: @rsp

Which is your SuiteCRM version?
Is this a default scheduler or a custom one?

@LionSolution

Server Configuration PHP 8.2
SuiteCRM Current Version: 7.14.6 (Upgrade from 7.13.2 to 7.14.4 and 7.14.4 to 7.14.6)

It is a custom scheduler that adds or removes fields from the product edit view.

Have you checked the permissions used to rebuild your files in your config.php or config_override settings?

Have you something like:

'default_permissions' => 
  array (
    'dir_mode' => 1533,
    'file_mode' => 436,
    'user' => '',
    'group' => '',
  ),

?

Yes, permission is correct. There is no issue with file permissions.

If a custom dropdown field in AOS_Products disappears and then reappears after a Quick Repair and Rebuild, these are a few potential explanations:

1. Database Mismatch Fixed by Quick Repair

  • SuiteCRM stores custom fields in both the database (_cstm tables) and the metadata files (custom/modules/AOS_Products/Ext/Vardefs).
  • If the field was missing due to a database inconsistency, the Quick Repair process might have detected the issue and prompted you to execute SQL statements to fix the structure.

2. File System Caching Issues

  • SuiteCRM heavily relies on cached metadata (cache/modules/...).
  • If the dropdown field was removed or modified but the cache wasn’t refreshed, it might not have been visible.
  • A Quick Repair rebuilds metadata and clears cached field definitions, making the field reappear.

3. Permissions or File Corruption

  • If the dropdown field was missing due to permission issues on SuiteCRM’s custom files, a Quick Repair may have regenerated the necessary files and restored visibility.

4. Customizations Overwritten

  • If a recent deployment or customization affected vardefs.php or dropdowns, the field might have been temporarily lost.
  • The Quick Repair process ensures all definitions are reloaded from custom/ directories.

5. Dropdown Definition Wasn’t Loaded

  • The dropdown options are stored in custom/include/language/...lang.php.
  • If the file wasn’t loaded properly (due to cache issues or an incorrect modification), a Quick Repair may have forced SuiteCRM to reload it.

:mag_right: Next Steps to Diagnose:

  1. Check custom/Extension/modules/AOS_Products/Ext/Vardefs
  • Ensure the field definition exists and was not accidentally removed.
  1. Check cache/modules/AOS_Products/AOS_ProductsVardefs.php
  • If the field disappears again, it may indicate SuiteCRM isn’t regenerating the cache correctly.
  1. Verify Dropdown Definition
  • Check custom/include/language/en_us.lang.php (or other languages) for your dropdown.
  1. Monitor Logs (suitecrm.log)
  • If the field disappears again, check SuiteCRM logs for errors related to AOS_Products.

What do you think about?