I have two fields in a company module:
Site ID = the ID number we use internally for a company
Outlet code = the ID number our customer uses for a company
I now want to include these fields on the “Create Case” form so that
The Site IDs and Outlet Codes already existing in the company module are options in these fields when I create the case.
When either the Site ID is entered on the “Create Case” form, the corresponding Outlet code auto-populates and vice versa.
Probably you edited the file custom/modules/Accounts/Ext/Vardefs/vardefs.ext.php. This file is rebuilt on running Quick Repair and Rebuild.
You have to create a php file inside custom/Extension/Accounts/Ext/Vardefs/ and save into that the codes I previously provided. After than run Quick Repair and Rebuild.
So if I have created a package called Gsites.
Within it is a module called Sites (based on accounts).
In my file structure, the module shows as custom/Extension/modules/sit01_SitesModule/
The fields I want to relate between modules are:
SiteID - In the fields list of the module builder, the field name shows as siteid_c and the system label shows LBL_SITEID
Outlet Code - In the fields list of the module builder, the field name shows as outletcode_c and the system label shows LBL_OUTLETCODE
Are the system labels important?
Going from your earlier post, should I then go to Cases extended vardefs and add:
$dictionary[‘Case’][‘fields’][‘sit01_SitesModule’][‘populate_list’] = array(
‘sit01_SitesModule_siteid_c’ => ‘case_siteid_c’,
‘sit01_SitesModule_outletcode_c’ => ‘case_outletcode_c’,
);
The fact is that you don’t need to worry about the name of field including its module, you just need to place the field’s name itself, for example:
Lets say you want to copy from Accounts to Cases the built in fields industry and account_type.
In Cases you created the fields industry_c and account_type_c, so the populate_list should be:
Using your example above:
Let’s say I have 20 accounts records. Each record has a text value in the industry field.
I add the industry_c field to the ‘Edit’ layout of cases using Studio.
If I then go to edit a case and go to the industry_c field and start to type, will I see a dropdown showing the fields from the accounts record?