Type property - Capacity field - Event Locations

Hi,

regarding the capacity field of the FP_Event_Locations module, we understand that this field indicates the number of people that can attend an event location and we believe that if it were of an integer type, it would have the advantage of being able to perform a dynamic search by range.

What are the reasons for the varchar type? Do you intend to indicate whether the attendees are adults, children, or something else indicated by text?

On the other hand, we have tried to change its type to integer and to activate the search by range from studio resulting in the vardef the following settings

$dictionary['FP_Event_Locations']['fields']['capacity']['type'] = 'int';

$dictionary['FP_Event_Locations']['fields']['capacity']['enable_range_search'] = 1;

$dictionary['FP_Event_Locations']['fields']['capacity']['options'] = 'numeric_range_search_dom';

However, in the basic and advanced search views it does not show the search by range functionality. Is it necessary to indicate something else?

Thanks in advance

Searching the code it seems that field is just to hold data, it is never used anywhere

–> https://github.com/salesagility/SuiteCRM/search?q=capacity&unscoped_q=capacity

When you change vardefs you need to run a QR&R, and scroll down to see if you need to sync the database.

Hi,

we have already applied the QR&R and we have already fixed the problem. In addition to changing the type in the vardefs.php file, we have also indicate the new type in the next files:

  • searchdefs.php
  • popupdefs.php
  • dashletviewdefs.php
  • listviewdefs.php

On the other hand, since the capacity field is oriented to put a number, do we create an issue to ask to change the type property to integer?

The string is more versatile. You can write “10 seated, 15 standing” or whatever you want.

For your requirement, I’d say you could have created a custom field instead. You can do it all from Studio, create the numeric field, add it to the views… that would be the normal “SuiteCRM way”

1 Like