Is there any place where the datatype values are stored? I need to know what kind of data they are in order to display them.
For example if the status field is a dropdown I will put a dropdown, if it is a text area I will put a text area etc.
Is there any place where the datatype values are stored? I need to know what kind of data they are in order to display them.
For example if the status field is a dropdown I will put a dropdown, if it is a text area I will put a text area etc.
The information is stored in the Vardefs
and can be accessed via the Metadata API
3 Tips for using the Sugar Metadata API
FrancescaS
No, the API is for v7.x and higher so it will not work in 6.5
But 6.5.x still has metadata for each of the modules, and that metadata describes your fields, including "name" and "type".
It's been a while since I worked in 6.x but each module should have vardefs in its directory:
modules/<module_name>/vardefs.php
and custom fields will be in:
custom/Extension/modules/<module_name>/Ext/vardefs.php
To get a list of fields for a given module programmatically, this should work in 6.x
$bean = BeanFactory::getBean($module_name);
$field_defs[$module_name] = $bean->getFieldDefinitions();
Each of those definitions should include the field "name" and "type".
Let me know if this helps.
Francesca
Yeah now i got the datatypes that i need, thank you a lot.