Display just the street field in a DetailView or EditView.

sugarcrmdevelopers —  October 10, 2012 — Leave a comment

Great question from the forums the other day…

I was trying to reorder billing and shipping address fields in the account module, when I encountered something odd. Below I describe the billing address issue, but it is the same for shipping.

– There is a field called LBL_BILLING_ADDRESS_STREET. It is added as default to Edit and Detail View. You would expect that this allows you to enter the STREET info. But what it actually does is that it creates a block of fields with billing street, city, postal code, state, and country info.
– In Labels there is a field named LBL_BILLING_ADDRESS, which is supposed to do the above, but it is not available in Edit View.
– As a result, there is no field to add a street address.

Of course, you can create a custom field, but then you have to make sure later on, that it is used instead of the factory street address field in all modules and documents.

QUESTION: Is there a way to fix this? How can I redefine LBL_SHIPPING_STREET to mean what it is meant to mean?

This is a confusing thing in the product, which looks to be corrected down the road. In the meantime, you can make a simple editviewdefs or detailviewdefs change to show only the field and not the whole block. Simply look for a block like this…
array (
            'name' => 'billing_address_street',
            'hideLabel' => true,
            'type' => 'address',
            'displayParams' =>
            array (
              'key' => 'billing',
              'rows' => 2,
              'cols' => 30,
              'maxlength' => 150,
            ),
          ),

Change it instead to just be…

'billing_address_street',

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s