Skip to content

Instantly share code, notes, and snippets.

@cmourizard
Created July 16, 2015 13:08
Show Gist options
  • Save cmourizard/fc64220d946d23f5f1ce to your computer and use it in GitHub Desktop.
Save cmourizard/fc64220d946d23f5f1ce to your computer and use it in GitHub Desktop.
Sugar 7 - Force auto populate without the confirm box
<?php
// Add fields in the mapping
$dictionary['Contact']['fields']['account_name']['populate_list']['team_id'] = 'team_id';
$dictionary['Contact']['fields']['account_name']['populate_list']['team_name'] = 'team_name';
$dictionary['Contact']['fields']['account_name']['populate_list']['team_set_id'] = 'team_set_id';
// Force the auto populate without the confirm box
$dictionary['Contact']['fields']['account_name']['auto_populate'] = true;
// Or add your custom alert mersssage
$dictionary['Contact']['fields']['account_name']['populate_confirm_label'] = 'TPL_AUTO_POPULATE_CUSTOM_LABEL';
// It's an Handlebar template, you can use some variables if you want:
// * {{moduleSingularLower}} : name of the module
// * {{values}} : list of the names of the fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment