Edit View differs from Studio Edit View - Salutation Field

Hi, just wondering how this is achieved:

Salutation and First Name fields appear in one column on Edit View…

…but not in Studio. Salutation field is still present in the Toolbox and has not been added to the layout.

I do like the layout and I would like to be able to do that myself.

Appreciate your time looking at this.

Thanks in advance

You need to modify your editviewdefs.php file for the module you want to achieve that funcionality:

Check file modules\Contacts\metadata\editviewdefs.php for a sample:

          0 =>
          array(
            'name' => 'first_name',
            'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value}&nbsp;<input name="first_name"  id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
          ),
          1 =>
          array(
            'name' => 'last_name',
          ),
        ),

Thanks,

BrozTechnologies

2 Likes

Just remove the “CustomCode” index from the editview defs, so your editview file should look like this

0 =>
array(
‘name’ => ‘first_name’,
),

@suitecrm_developer,

I don’t think you you understood the question. I might be wrong do?

BrozTechnologies

Hi,
I thought he wants to make editview file and the studio UI similar.
So i told the one possibility to remove the salutation field from the editview file.
The second possibility is to remove the salutation field from the current array and put it in separate index to make them show in different columns both in the view and within studio.

Hi, @BrozTechnologies and @suitecrm_developer,
To clarify, I want to achieve the “two fields in one column” view that is shown in the first picture. From what I understand and from what you’re both saying and please correct me if I’m incorrect, I can’t do that in Studio, I must do it using code.

I’ve tried the code (I’m not a coder but I can follow instructions) and it does what I want, displays two fields in one column…


…but it’s not populating any values from the salutation_dom dropdown list.

Here’s my code:

          0 =>
          array (
            'name' => 'first_name',
            'customCode' => '{html_options name="salutation" id="salutation" options=$fields.salutation.options selected=$fields.salutation.value}&nbsp;<input name="first_name"  id="first_name" size="25" maxlength="25" type="text" value="{$fields.first_name.value}">',
          ),
          1 => '',
        ),

Sorry!

Worked it out. I’m using a different field name so changed all references to salutation to title.

Thanks

I’m glad it worked.!!!