No match for field error

Hi all,

I’m building a new module which uses a number of relate fields using the studio.

Although the relation works (you can select a record when in edit view) when saving the new record a couple the relate fields get the following error

No match for field:

I’ve done the obvious stuff, ran repair and rebuild, rebuild relationships and even went as far as dropping all the tables and reinstalling but the issue won’t change. There are 10 relate fields all relating to the same module 3 of 10 have this issue and they were setup in the exact same way.

Is there a manual way of repairing this?

Thanks

Urbanite.

I’ve never heard of this, but I can try some approach to a solution…

Find the error message:

include/language/en_us.lang.php:1379:    'ERR_SQS_NO_MATCH_FIELD' => 'No match for field: ',

Now find that label. It gives 27 results, so you’ll have to see which ones it makes sense to inspect. Try starting a debug session near those points.

Note that “SQS” is related to the find-as-you-type search that these boxes have. So maybe there is a value in there for some reason, that is not present in the related module?

Good luck.

Hi pgr,

Thanks for responding, I’m not sure I follow what you’ve written. How do I actually do what you’re saying?

I’d like to stress that I’m not using any custom code, I’m just using the module builder which suggests to me (at least on the surface) it’s a problem with SuiteCRMs module builder. I’ve been able to replicate this several times on my test installation; I’m going to duplicate my live environment and see if it happens there too.

Are there any known limitations with using the module builder?

Thanks

Urbanite

Recreated the problematic module and the issue occurs still. In addition I get this error

 Smarty error: [in cache/themes/SuiteP/modules/ordv2_ordersystem/DetailView.tpl line 3552]: syntax error: unrecognized tag: $fields..value (Smarty_Compiler.class.php, line 448) in /var/www/html/suitecrm/include/Smarty/Smarty.class.php on line 1100

I’ve done a little bit of Googling and this issue occurs back in Sugar too so I’m guessing an unfixed bug relating to a limit of how many relate fields you can create that relate to the same module.

I’ve seen that one before! It looks like a fixed bug to me, not an unfixed one…

Which version of SuiteCRM are you using?

Running 7.10.5, I couldn’t see anything in the release notes that looked like my issue.

It’s hard to be sure, sometimes the names of the PR’s aren’t very clear when all you have is an error message.

Can you try the online demo that has admin access, here?

https://www.softaculous.com/demos/SuiteCRM

This will tell you if it’s fixed in the newest version.

Unfortunately the issue still remains.

It’ seems like once you exceed 7 related fields to the same module it starts causing issues.

However, what I have now noticed in the logs that when this error happens the following appears in the logs. It looks unrelated…

Tue Sep  4 14:38:34 2018 [579][1][FATAL]  Query Failed: SELECT leads.id AS id, accounts.id AS 'accounts_id' FROM leads LEFT JOIN accounts accounts ON leads.account_id=accounts.id AND accounts.deleted=0

 WHERE accounts.lead_id_c != '' AND leads.deleted = 0 : MySQL error 1054: Unknown column 'accounts.lead_id_c' in 'where clause'

You added a lead_id custom field in accounts?

When you do a Quick Repair and Rebuild, scroll down to the bottom to see if there is a button there to “sync vardefs”. If there is, press it.

No such field or vardef exists and running repair does not suggest any missing fields on the database.

See this

https://community.sugarcrm.com/thread/20535

Did you migrate a database from a previous installation?

The error above looks to be a result of an old workflow.

Going back to my original problem I’ve found the issue and created a manual solution.

SuiteCRM is using name_id in vardefs.php more than once when generating a vardefs.php. So input multiple fields are refering to same field which must be causing issues when you go to save.

The solution is to edit vardefs and ensure there are no duplicate ids. I’ve done this and it seems to have resolved the issue.

Thanks

Here’s an example…

 
    'umap_purchaseitems_id11_c' =>
    array (
      'required' => false,
      'name' => 'umap_purchaseitems_id11_c',
      'vname' => 'LBL_PRODUCTCODE1_UMAP_PURCHASEITEMS_ID',
      'type' => 'id',
      'massupdate' => 0,
      'no_default' => false,
      'comments' => '',
      'help' => '',
      'importable' => 'true',
      'duplicate_merge' => 'disabled',
      'duplicate_merge_dom_value' => 0,
      'audited' => false,
      'inline_edit' => true,
      'reportable' => false,
      'unified_search' => false,
      'merge_filter' => 'disabled',
      'len' => 36,
      'size' => '20',
    ),
    'productcode1' =>
    array (
      'required' => false,
      'source' => 'non-db',
      'name' => 'productcode1',
      'vname' => 'LBL_PRODUCTCODE1',
      'type' => 'relate',
      'massupdate' => 0,
      'no_default' => false,
      'comments' => '',
      'help' => '',
      'importable' => 'true',
      'duplicate_merge' => 'disabled',
      'duplicate_merge_dom_value' => '0',
      'audited' => false,
      'inline_edit' => true,
      'reportable' => true,
      'unified_search' => false,
      'merge_filter' => 'disabled',
      'len' => '255',
      'size' => '20',
      'id_name' => 'umap_purchaseitems_id11_c',
      'ext2' => 'UMAP_purchaseitems',
      'module' => 'UMAP_purchaseitems',
      'rname' => 'name',
      'quicksearch' => 'enabled',
      'studio' => 'visible',
    ),


   'productcode10' =>
    array (
      'required' => false,
      'source' => 'non-db',
      'name' => 'productcode10',
      'vname' => 'LBL_PRODUCTCODE10',
      'type' => 'relate',
      'massupdate' => 0,
      'no_default' => false,
      'comments' => '',
      'help' => '',
      'importable' => 'true',
      'duplicate_merge' => 'disabled',
      'duplicate_merge_dom_value' => '0',
      'audited' => false,
      'inline_edit' => true,
      'reportable' => true,
      'unified_search' => false,
      'merge_filter' => 'disabled',
      'len' => '255',
      'size' => '20',
      'id_name' => 'umap_purchaseitems_id11_c',
      'ext2' => 'UMAP_purchaseitems',
      'module' => 'UMAP_purchaseitems',
      'rname' => 'name',
      'quicksearch' => 'enabled',
      'studio' => 'visible',
    ),

For a relate field. There are 10 fields from productcode1 - productcode10

Good detective work you’ve done there! B-)

Then this is a bug, right? Could you please report it on GitHub with all these exact steps to reproduce and fix?

Or better yet, if you can fix the bug in the main code where it produces the vardefs.php file, and make a PR on GitHub?

Hi,

I have also a problem with “No match for field:” but it is with custom modules when I want to auto-populate fields.
In vardef.php file I can see that under relationships there is nothing.

I have tried to myself write the relation inside, but no luck.

This is my code:

 array (
            'name' => 'pm_project_management_pm_monitoring_units_name',
            'displayParams' => 
            array (
              'field_to_name_array' => 
              array (
                'id' => 'pm_project_management_pm_monitoring_units_id',
                'name' => 'pm_project_management_pm_monitoring_units_name',
                'element' => 'element',
                'sub_element' => 'sub_element',
              ),
            ),
          ),

When I remove ID and NAME, I can not see a text record name; values element & sub-element are copied but the name remains empty ?!?!
When I have all this, and try to save i get: “No match for field: Monitoring Units”.

Does anyone know what can be an issue here?
Best regards,
Filip

I had this error too : “No match for field: Comptes”

Its because when I delete an account that have a parent account (Custom relationship : accounts_accounts_1) it DONT delete the relation in the table accounts_accounts_1_c.

Wich is for me a serious error, im planning to open an issue on github. I’ve created the relatiopnship in the studio, a one to many account to account.

It dont happend with the original “parent_name” relationship (wich is a default relationship from SuiteCRM).