How to Add a Custom Text Field by programatically in SuiteCRM

Introduction: In SuiteCRM, you can customize fields to fit your business better. Adding a custom text field lets you store extra information important to your workflows. This guide will show you how to add one to the Contacts section.

Steps:

  1. Go to the Customization Directory:
  • Find your SuiteCRM folder.
  • Inside it, go to custom/Extension/modules/Contacts/Ext/Vardefs/.
  1. Create a New File:
  • Make a new PHP file there and name it custom_field.php.
  1. Define the Field:
  • Open custom_field.php and paste this code:

    • <?PHP $dictionary['Contact']['fields']['custom_text_field'] = array( 'name' => 'custom_text_field', 'vname' => 'LBL_CUSTOM_TEXT_FIELD', 'type' => 'varchar', 'len' => '255', 'required' => false, 'reportable' => true, // Add more details if needed );
      • Change 'Contact' if customizing another section.
      • Adjust other details as needed.
  1. Save the File:
  • Save your changes.
  1. Update SuiteCRM:
  • Log in as an admin.
  • Go to the Admin panel.
  • Click “Repair”, then “Quick Repair & Rebuild”.
  • This will apply the changes.

Conclusion: Customizing SuiteCRM fields helps it work better for you. Adding a custom text field is simple and makes managing your data easier. Follow these steps to get it done!

That’s helpful. You can try to post in technical blog:

SuiteDocs

I believe this is already explained in the Docs, in the chapter about Vardefs.

1 Like

Thanks you.
This steps can helpful.