Auto populate System ID when Selecting an Equipment

Hello All,

Iā€™m sorry for posting this, but I was looking for instructions to make a change on my system, however I couldnā€™t find any procedure that would guide me trough what I want to do, if I can learn how to do it once, I think I will be back to make another changes of the same kind.

I have altered the Case module to have associated the Equipment which I am open a case for.

There is a relationship between the two modules (Case and Equipments) Many-to-Many

I can select the Equipment and on the Case form there is a field called (System ID) which is a field also contained on the Equipment form.

When selecting the Equipment by its HOSTNAME which is the (main field for the Equipment) I would like to the system ID be auto populated).

I know it seems to be redundant posting ā€œauto populateā€ topic, but I couldnā€™t really find a STEP BY STEP to how to do this.

If someone could give me first steps to get it done, I appreciate.

Hi,

to me this looks like a one:many relationship, is that correct?

To achieve the addtional field to be populated you will need to edit the editviewdefs.php of the Cases modules manually.
Find your relation field to the equipment module and add:
ā€˜field_to_name_arrayā€™ => array( ā€˜FIELDFROMEQUIPMENTā€™ => ā€˜FIELDTOPOPULATEā€™),

to the field displayParams array of your field.

Martin

Hi Martin,

Thank you for answering me, but could you continue helping meā€¦

the relationship is many:many (printscreen)

I have found the file you said editviewdefs.php inside of

www/suitecrm/modules/Cases/metadata/[color=#ff0000]editviewdefs.php[/color] is that the correct file?

Then Iā€™ve tried to find the ā€˜displayParamsā€™ line in which I should add what you askedā€¦ below the lines

line #120

[color=#008800]array[/color] (
[color=#ff00ff]ā€˜nameā€™[/color] => [color=#ff00ff]ā€˜nameā€™[/color],
[color=#ff00ff]ā€˜displayParamsā€™[/color] =>
[color=#008800]array[/color] (

Where exactly should I add the [color=#0044ff] ā€˜field_to_name_arrayā€™ => array( ā€˜FIELDFROMEQUIPMENTā€™ => ā€˜FIELDTOPOPULATEā€™),[/color]

then I would ADD something like:

[color=#008800]ā€˜field_to_name_arrayā€™ => array( ā€˜serial_number_cā€™ => ā€˜system_id_cā€™),[/color]

is my logic correct?