Grab related record content via Web Services

sugarcrmdevelopers —  July 22, 2013 — Leave a comment

While we have been talking about the new RESTful Web Services in Sugar 6.7 and later quite a bit lately, I wanted to touch on a topic that pertains to the existing web services interface that has been a part of the Sugar product for quite sometime; grabbing related records. Here’s the specific query we had recently…

Is there any way of retrieving data from a relate field using Sugar API? I am currently using get_entry call to get values of the fields and load data using relationships, but we have a few relate fields (related with Users module) and I am trying to get some data from the Users module in one call. Is there any way of doing it?

There is an extra parameter for the calls of get_entry/get_entries/get_entry_list called link_name_to_fields_array, which enables you to do just this. All you need to know is the link field name for the relationship, and then you can reach across it to grab the related record fields. See the below example for an idea how to do this for grabbing the actual user’s name of the person who last modified the record…

The result will look something like this…

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s