0

I have a task to develop plugin for SugarCRM. Plugin should be "hooked" to contacts, leads and/or targets.

After I add contact to SugarCRM plugin should send data (with some fileds) to specific webservice (method to insert new person into DB).

I did create logical hook to contacts and before save I send data to webservice.

My biggest problem are fields. SugarCRM admin should be able to make setup for plugin like this

  1. Plugin gets list of fields from webservice
  2. Admin maps fields from "SugarCRM contacts" to "webservice persons" fields

for example


SugarCRM contact | webservice person

"first_name" => "firstname"

"last_name" => "familyname"

"gender" => "mf" ....

So when contact is added to SugarCRM, plugin should be able to read this setup and match every field before sending to webservice.

Can someone give me tips how to start with this, is there something similar online?

Thanks

1 Answers1

0

You could create a dropdown menu where the left value is the SugarCRM Field name and the right value is the Webservice field name. Then direct users/system administrator to modify this dropdown in the Dropdown Editor, which has a nice and easy interface.

The plugin can then access this menu as a key => value array with $GLOBALS['app_list_strings']['my_list_name']

Alternatively, you can create your own configuration page if you want to develop a custom interface for this. A starting point for that might be this article, although it was written with SugarCRM 6 in mind: http://www.profilingsolutions.com/archive/quick-configuration-pages/

The configuration page would write to the Configurator (stored in config_override.php), as Antonio Musarra pointed out.

Either way, a caveat you'll encounter is that users will mistype field names. You'll need some sort of validation in your webservice call to ensure that all fields actually exist within the web server and within SugarCRM.

Matthew Poer
  • 1,682
  • 10
  • 17