Extra Street Address Fields

Hello,

We are currently running SuiteCRM 8.3.1 but will soon upgrade to 8.4.0.

In the contact and target modules there is only a single street field i.e. “primary_address_street”

However in the UK we do need extra street fields for our addresses. How would I add “primary_address_street2” and “primary_address_street3” fields to both the target and contact modules? Is the process the same for versions 8.3.1 and 8.4.0 ?

Would the target import feature import the two new fields i.e. “primary_address_street2” and “primary_address_street3” by default or would further changes be needed ?

Would I loose the above customisations when I upgrade from SuiteCRM 8.3.1 to 8.4 ?

Thanks

Hi @Andrew_C , Do you have resolve the issue?

Hi nhat.thieu,

Sadly none of the developers got in contact with suggestions on how to easily add the extra address fields to the database and forms etc.

In my view the extra address fields would be a basic requirement for targets, leads, contacts and accounts here in the UK where companies like multi-line addresses.

I have spent half my working life writing software and would happily contribute to the project if the development documentations was more complete.

If you learn of a way to add the extra address fields then please let me know.

Thanks.

@Andrew_C In 7.x (should be same in 8.x), primary_address_street shows on screen as a multi-line text box which holds 3 lines of text.

Hi @Andrew_C

@chris001 -has made a helpful comment.

This may be less helpful for you, but others reading the forum may be thinking it: In the Admin pages the Studio feature allows the creation of any custom fields you like: does that need help in your situation for some specific reason?

@chris001 We are running 8.4.1. On the target form, primary_address_street is a single text box, not multi-line. In Studio its defined as a text field of 150 characters.

Thanks.

While I was evaluating SuiteCRM 8.0.3 last year I do remember that the Primary_address _street on targets, leads, contacts and accounts were only single line fields. At the time I made some enquiries and seem to remember being told that multi line fields were not supported in V8.x and there was a GitHub bug report of the issue however I can’t seem to find one now either open or fixed.

I have just checked the online version of SuiteCRM 8.4.1 and it matches my local copy of V8.4.1 i.e. that the Primary_address_street is a single line text field only. From comments made earlier in this thread I am assuming that V7.x has multi line field Primary_address_street. Can someone please confirm ?

When I get some free time I plan to install SuiteCRM V7.x side by side with my V8.4.1 install so I can compare the differences in feature sets.

In the mean time can a developer please confirm if V8.x supports multi line fields and the fact that Primary_address_street is only a single text field is a bug which will be fixed. Or if multi line fields will never be supported in V8.x and Primary_address_street will only ever be a single line in V8.x ?

For those who have migrated from V7.x to V8.x how did you cope with the loss of multi line street addresses and was there any data loss ? If you would like multi line street address in V8.x please add your comments to the thread to let the developer know the importance of this feature.

Thanks.

If you want to compare behaviors,

v7 demo

→ SuiteCRM Demo

v8 demo

→ SuiteCRM

On both, User: will / Pass: will

I believe that these are single-line fields, but at least in v7, the address fields were composite fields, like a field made up of several sub-fields (see here). I’m not sure how this is handled in v8 (maybe this)

Thanks for the links to the V7.x and V8.x demo’s. Sadly you can’t use studio in the demo’s.

V7.x clearly has multi line address street which is great . However V8.x has only a single line address street which is a massive limitation for any CRM.

Why did the developers not implement a multi line address street as per V7.x in V8.x. And more importantly what happens when you migrate from V7.x to V8.x ? Are multi line addresses lost ?

V8.x has been out for over a year. Why have the developers not fixed this massive limitation with V8.x ? It glaringly obvious to any user.

The link to the other thread is about the order of the address components on the form which is also a minor issue too. But its does not suggest a fix for missing multi line address street in V8.x

Can the developers fix this quickly or am I doomed to rolling out the older V7.x and then migrating to V8.x when its fixed if ever ?

Who else thinks a single address street in V8.x is a massive limitation ?

Thanks

Hello,

I have raised a bug report for this issue.

If anyone else is having similar problems then please add a comment to the bug report so the developers will implement a fix soon.

Thanks.

Hey @Andrew_C,

I know its been a few days, but I’ve just stumbled upon this, which got me curious and decided to have a look at the code.

The address fields is mapped to a group-field which seems to be a new concept in SuiteCRM 8. It basically groups several fields and shows them in one slot. There is an auto mapping from old field to group fields see: config/services/record/fields/grouped_fields_type_map.yaml

I think you can change the address street to a field of type text in a upgrade safe way, just by changing the type of the address street type in vardefs.

Take the accounts billing address street as an example to change it you could do:

  1. Add upgrade safe custom file:
  • public/legacy/custom/Extension/modules/Accounts/Ext/Vardefs/billing-address.php
  1. Add the following code to the file
<?php

$dictionary['Account']['fields']['billing_address_street']['type']='text';


  1. Run Quick Repair and Rebuild from the admin panel

It should look something like (only just changed the billing one so we can see the difference):

Edit mode:

Detail mode:

However as you see the street field is taking a lot of space.

For it to look a bit better you can do:

  1. Update the following code to :
  • file: public/legacy/custom/Extension/modules/Accounts/Ext/Vardefs/billing-address.php

  • the following changes assume max 2 lines. but if you think there will be more you can change the value of rows to 3, 4 or whatever you think is reasonable.

<?php

$dictionary['Account']['fields']['billing_address_street']['type']='text';
$dictionary['Account']['fields']['billing_address_street']['metadata'] = $dictionary['Account']['fields']['billing_address_street']['metadata'] ?? [];
$dictionary['Account']['fields']['billing_address_street']['metadata']['rows'] = 2;

  1. Run Quick Repair and Rebuild from the admin panel

it should look like the following

edit mode:

detail mode:

1 Like

Hello @anthony.oak.castro,

Thanks for your reply.

Before I try your solution I wanted to re-state what the issue is and provide some screen images.

If you create or edit a target, lead, contact or account you can only enter a single line for the address street field by default. See target as an example.

However when you create an invoice the billing and shipping street is already multi-line by default. which is great

So how do to I make address street multi-line when I create or edit a target, lead, contact and account and will that multi-line address street be stored in the database ?

Thanks

Hey @Andrew_C,

I think that in Invoices it shows as text area because Invoices is using classic view, see: Youtube: The Classic View in SuiteCRM 8 Explained

and from config/services/module/module_routing.yaml we can see the record view is set to show is classic view mode.

    invoices:
      index: true
      list: true
      record: false

I don’t know a way to change the type of the address street field for all modules at once, because they are declared separately and have different keys on each module, e.g. billing_address_street, primary_address_street, etc.

With the solution on my previous post you need to add a custom vardef definition to the street field of each module: targets, leads, contacts and accounts .

And yes, by changing the type of the field to text it is stored on the db with multi-lines

Hello @anthony.oak.castro,

Thanks for your reply.

I will give your solution a try for targets, leads, contacts and accounts.

It will then be possible to manually view, enter and store multi-line address_street into the database.

The next step would be to import thousands of targets into the database that have a multi line address_street.

Would any further code modifications be necessary to enable the ability to import or export targets with a multi-line address_street using CSV files or will your solution also enable the ability to do so ?

And what delimiter character would I use in between each saddress_street line in the CSV file ?

Thanks.

Hey @Andrew_C,

I would need to test… However, if the records you want to import come from Suite 7 they should work without any change.

Also after this change when you do the Repair and Rebuild any existing records should be updated to the new column format and the data should be kept. Usually there aren’t many issues when changing from a varchar to text, the db manager (mysql, etc) should be able to handle that.

I don’t think you need to change that, just keep what is there. Though, I think the character is a \n.

No, you shouldn’t… The csv delimiter should be the same used on any import/export csv from SuiteCRM.

Here is an example when trying to open exported rows on LibreOffice

Anyway, I would need to test as I may be missing something.

Hello @anthony.oak.castro,

Thanks for testing. I will hold off implementation until you are confident it all works.

Just to confirm there are no target records currently. I will be creating new target import CSV’s from scratch with data held in other systems. And then I will import the CSV into SuiteCRM Targets in batches.

Thanks .

Hey @Andrew_C,

I gave it a try, I’ve exported from a suite 7 and imported into a suite 8 with the changes mentioned above. It seems to work fine. Only tested with accounts.

The result in detail mode using the same csv shown on my previous post:

image

Anyway, this seems to be a viable alternative… Now you need to check and see if it makes sense for your system or not…

Hello @anthony.oak.castro,

Thanks for your efforts, I will give it a try tomorrow.

One thing I can’t understand is that V7.x has multi line address capability. Why did the developers not implement it in V8.x by default. It does not seem a logical decision . I would appreciate your thoughts.

Thanks.

1 Like

Hey @Andrew_C,

No problem, you’re welcome.

Regarding the decision, I don’t know. SuiteCRM angular frontend is a BIG re-write… one that I think SuiteCRM was really needing… This address issue might just have been overlooked. Big re-writes have this downside…

On that note, one thing that helped me was the SuiteCRM 8 journey page. Where they explain that SuiteCRM 8 is still in the process of “leveling up” to Suite 7. It gives a better understanding about were SuiteCRM 8 is at the moment and what I can expect from it:

1 Like